auth
Authentication management commands for NDCLI. These commands handle OAuth2 authentication with the NetDefense platform.
Commands
Section titled “Commands”| Command | Description |
|---|---|
auth login | Authenticate with NetDefense |
auth logout | Log out and revoke tokens |
auth show | Show current authentication status |
auth me | Show authenticated user information |
auth refresh | Force refresh the access token |
auth migrate | Migrate tokens from file to keyring |
auth delete | Permanently delete your account |
auth login
Section titled “auth login”Authenticate using the OAuth2 device authorization flow. This opens your default browser to complete authentication.
ndcli auth login [flags]| Flag | Type | Default | Description |
|---|---|---|---|
--force | bool | false | Force new login even if already authenticated |
--scopes | string | from config | OAuth2 scopes to request |
Examples
Section titled “Examples”# Standard loginndcli auth login
# Force re-authenticationndcli auth login --force
# Login with custom scopesndcli auth login --scopes "openid profile email"How It Works
Section titled “How It Works”-
Request device code — NDCLI requests a device code from the authentication server
-
Display verification URL — A URL and user code are displayed in your terminal
-
Browser authentication — Your browser opens to the authentication page
-
Enter code — Enter the user code and complete authentication
-
Tokens stored — NDCLI receives and securely stores your tokens
auth logout
Section titled “auth logout”Log out and revoke the current access tokens. This removes stored credentials from the keyring or file storage.
ndcli auth logoutExamples
Section titled “Examples”ndcli auth logoutauth show
Section titled “auth show”Display the current authentication status including token expiry information.
ndcli auth showOutput
Section titled “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
Section titled “Examples”ndcli auth showauth me
Section titled “auth me”Show detailed information about the currently authenticated user.
ndcli auth meOutput
Section titled “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
Section titled “Examples”# View your user infondcli auth me
# Output as JSONndcli auth me -f jsonauth refresh
Section titled “auth refresh”Force refresh the access token using the stored refresh token. This is typically handled automatically by NDCLI when needed.
ndcli auth refreshUse Cases
Section titled “Use Cases”Examples
Section titled “Examples”ndcli auth refreshauth migrate
Section titled “auth migrate”Migrate authentication tokens from file-based storage to the system keyring. This improves security by storing tokens in the OS credential manager.
ndcli auth migrateSupported Keyrings
Section titled “Supported Keyrings”| Platform | Keyring |
|---|---|
| macOS | Keychain |
| Linux | Secret Service (GNOME Keyring, KWallet) |
| Windows | Credential Manager |
Examples
Section titled “Examples”ndcli auth migrateauth delete
Section titled “auth delete”Permanently delete your NetDefense account. This action cannot be undone.
ndcli auth delete [flags]| Flag | Type | Default | Description |
|---|---|---|---|
--yes | bool | false | Skip confirmation prompt |
Examples
Section titled “Examples”ndcli auth delete