Skip to content

auth

Authentication management commands for NDCLI. These commands handle OAuth2 authentication with the NetDefense platform.

Commands

CommandDescription
auth loginAuthenticate with NetDefense
auth logoutLog out and revoke tokens
auth showShow current authentication status
auth meShow authenticated user information
auth refreshForce refresh the access token
auth migrateMigrate tokens from file to keyring

auth login

Authenticate using the OAuth2 device authorization flow. This opens your default browser to complete authentication.

Terminal window
ndcli auth login [flags]

Flags

FlagTypeDefaultDescription
--forceboolfalseForce new login even if already authenticated
--scopesstringfrom configOAuth2 scopes to request

Examples

Terminal window
# Standard login
ndcli auth login
# Force re-authentication
ndcli auth login --force
# Login with custom scopes
ndcli auth login --scopes "openid profile email"

How It Works

  1. Request device code — NDCLI requests a device code from the authentication server

  2. Display verification URL — A URL and user code are displayed in your terminal

  3. Browser authentication — Your browser opens to the authentication page

  4. Enter code — Enter the user code and complete authentication

  5. Tokens stored — NDCLI receives and securely stores your tokens


auth logout

Log out and revoke the current access tokens. This removes stored credentials from the keyring or file storage.

Terminal window
ndcli auth logout

Examples

Terminal window
ndcli auth logout

auth show

Display the current authentication status including token expiry information.

Terminal window
ndcli auth show

Output

  • Auth Status — Whether you’re authenticated or not
  • Storage Location — Keyring or file-based storage
  • Token Expiry — When your access token expires
  • Refresh Token — Whether a refresh token is available

Examples

Terminal window
ndcli auth show

auth me

Show detailed information about the currently authenticated user.

Terminal window
ndcli auth me

Output

Displays user profile information retrieved from the authentication server:

  • Email — Your registered email address
  • Name — Your display name
  • User ID — Unique identifier
  • Profile — Other profile attributes

Examples

Terminal window
# View your user info
ndcli auth me
# Output as JSON
ndcli auth me -f json

auth refresh

Force refresh the access token using the stored refresh token. This is typically handled automatically by NDCLI when needed.

Terminal window
ndcli auth refresh

Use Cases

Examples

Terminal window
ndcli auth refresh

auth migrate

Migrate authentication tokens from file-based storage to the system keyring. This improves security by storing tokens in the OS credential manager.

Terminal window
ndcli auth migrate

Supported Keyrings

PlatformKeyring
macOSKeychain
LinuxSecret Service (GNOME Keyring, KWallet)
WindowsCredential Manager

Examples

Terminal window
ndcli auth migrate