Skip to main content
Return a successful exit code if the caller is still authenticated to Namespace. nsc auth check-login verifies that you are currently authenticated and that your session is still valid. When everything is valid, it exits with code 0. When there is a problem it will exit with a non-zero exit code. This is useful for scripts that need to check for a valid login.

Usage

Examples

Logged in:

Output

Not logged in:

Output

Options

—duration

Checks whether the current session can issue credentials valid for at least this duration. Defaults to 5m. Fails if the current session is expired, revoked, or too close to expiration.
Last modified on August 20, 2026