Skip to content

vault login

Authenticate to Vault and target a specific Vault instance.

Authenticate to a Vault and make it the active Vault. Without credential flags, opens a browser window to log in. With --access-token, --session-id, or --password, authenticates directly without a browser.

If the login resolves to a username already stored at the same scope, it replaces that user's stored credentials.

Logins are stored under your Vault username. The CLI stores one session per username and keeps one user active at a time. By default, a login is kept for the current shell only. Use --scope global to save it for every shell on this computer. In an interactive terminal, the CLI prompts for confirmation before saving a global login, defaulting to no.

vault login [--dns <DNS>] [--username <USERNAME>] [--access-token] [--session-id] [--password] [--scope <SCOPE>]
OptionTypeRequiredDescription
--dns <DNS>stringRequired for --access-token, --session-id, and --passwordVault DNS (for example, myorg.veevavault.com). With browser login, skips the Vault picker
--username <USERNAME>stringRequired for --passwordVault username. With browser login, the CLI prompts for it if omitted
--access-tokenflagOptionalLog in with an API access token. The token is read from a hidden prompt or piped stdin
--session-idflagOptionalLog in with an existing session ID. The value is read from a hidden prompt or piped stdin
--passwordflagOptionalLog in with a username and password. The password is read from a hidden prompt or piped stdin
--scope <SCOPE>shell | globalOptionalWhere to keep this login. shell (default) keeps it in the current shell only, including subshells and scripts started from it. global saves it for every shell on this computer, including scripts and agents started from any of them

This command also accepts the global options.

vault login --dns myorg.veevavault.com

If you have access to more than one Vault, the CLI shows a picker listing Vault names. Pass --dns to target a specific Vault and skip the picker.

vault login --dns myorg.veevavault.com --access-token

The CLI prompts for the token with echo disabled.

vault login --dns myorg.veevavault.com --username user@example.com --password

The CLI prompts for the password with echo disabled.


Remove a stored user's credentials and end their Vault session.

vault logout [<USERNAME>] [--all]
OptionTypeRequiredDescription
<USERNAME>stringOptionalUsername to log out. Default: the current user. Cannot be combined with --all
--allflagOptionalLog out every stored user. Cannot be combined with <USERNAME>

This command also accepts the global options.