HCVA0-003 practice question 10 of 35

Christy has created a token and needs to use that token to access Vault. What command can she use to authenticate and access secrets stored in Vault?…

Full set: 285 questions
Christy has created a token and needs to use that token to access Vault. What command can she use to authenticate and access secrets stored in Vault? $ vault token create -policy=christy Key Value --- ----- token hvs.hxDIPd8RPVtxu4AzSGS1lArP token_accessor AxwxpDs6LbdFQbWGmBDnwIK3 token_duration 24h token_renewable true token_policies ["christy" "default"] identity_policies [] policies ["christy" "default"]
Answer options
A: vault login hvs.hxDIPd8RPVtxu4AzSGS1lArP Correct answer
B: vault login -method=password
C: vault login -method=token christy
D: vault login -accessor=AxwxpDs6LbdFQbWGmBDnwIK3
Correct Answer:
A. vault login hvs.hxDIPd8RPVtxu4AzSGS1lArP
Explanation

The vault login command is used to authenticate to a Vault server. When using the token authentication method, which is the default, the token's secret value can be provided directly as an argument to the command. The command vault login hvs.hxDIPd8RPVtxu4AzSGS1lArP correctly passes the token value, allowing the Vault CLI to store it in the local token helper for use in subsequent API requests. This is the standard and most direct way to authenticate using a pre-generated token.

Why Incorrect

B. vault login -method=password This command specifies the password authentication method, which requires a username and password, not a token.
C. vault login -method=token christy This command incorrectly supplies a username (christy) instead of the secret token value required by the token authentication method.
D. vault login -accessor=AxwxpDs6LbdFQbWGmBDnwIK3 A token accessor is an identifier used for token management tasks like revocation or renewal; it cannot be used for authentication.

References

1. HashiCorp Vault Official Documentation, vault login Command:

Reference: In the documentation for the vault login command, it states: "If a single argument is specified, it will be used as the token for the token auth method." This directly validates the syntax used in option A.

Source: HashiCorp, "login Command," Vault Documentation, developer.hashicorp.com/vault/docs/commands/login.

2. HashiCorp Vault Official Documentation, Tokens Concept:

Reference: The section on "Token Accessors" explicitly states: "An accessor is a value that can be used to look up a token's properties and to revoke a token, but it cannot be used to authenticate to Vault." This confirms why option D is incorrect.

Source: HashiCorp, "Tokens," Vault Documentation, developer.hashicorp.com/vault/docs/concepts/tokens#token-accessors.

Scroll to Top