Skip to content

auth

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

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 deletePermanently delete your account

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

Terminal window
ndcli auth login [flags]
FlagTypeDefaultDescription
--forceboolfalseForce new login even if already authenticated
--scopesstringfrom configOAuth2 scopes to request
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"
  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


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

Terminal window
ndcli auth logout
Terminal window
ndcli auth logout

Display the current authentication status including token expiry information.

Terminal window
ndcli auth show
  • 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
Terminal window
ndcli auth show

Show detailed information about the currently authenticated user.

Terminal window
ndcli auth me

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
Terminal window
# View your user info
ndcli auth me
# Output as JSON
ndcli auth me -f json

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

Terminal window
ndcli auth refresh
Terminal window
ndcli auth refresh

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
PlatformKeyring
macOSKeychain
LinuxSecret Service (GNOME Keyring, KWallet)
WindowsCredential Manager
Terminal window
ndcli auth migrate

Permanently delete your NetDefense account. This action cannot be undone.

Terminal window
ndcli auth delete [flags]
FlagTypeDefaultDescription
--yesboolfalseSkip confirmation prompt
Terminal window
ndcli auth delete