VAULT-ASSOCIATE-002 · Question #60
Which of the following is the correct option to authenticate to Vault using a token using the CLI?
The correct answer is B. vault login. To authenticate to Vault using an existing token via the CLI, the vault login command is used, which prompts for or accepts the token as an argument.
Question
Options
- AA token can be used to authenticate to Vault through the API, not the CLI or the UI
- Bvault login
- DA token cannot be used to authenticate to Vault
How the community answered
(41 responses)- A2% (1)
- B93% (38)
- D5% (2)
Why each option
To authenticate to Vault using an existing token via the CLI, the `vault login` command is used, which prompts for or accepts the token as an argument.
A token can indeed be used to authenticate to Vault through the CLI and UI, not just the API, as tokens are a primary method of authentication across all interfaces.
The `vault login` command is the standard way to authenticate to Vault using the CLI. When authenticating with a token, `vault login` will either prompt the user for the token value or accept it as an argument (e.g., `vault login <token_value>`).
This statement is incorrect; tokens are a fundamental and widely used method of authentication to Vault.
Concept tested: Vault CLI token authentication
Source: https://developer.hashicorp.com/vault/docs/commands/login#login-with-a-token
Topics
Community Discussion
No community discussion yet for this question.