VA-003 Utilize Vault CLI and API Practice Question
A developer wants to authenticate to Vault using LDAP credentials. Which CLI command should they use?
⚠ Common exam trap
Candidates often confuse the raw API endpoint (`vault write auth/ldap/login`) with the correct CLI login command (`vault login -method=ldap`), or mistake enabling the auth method for performing authentication.
Answer choices
Why each option matters
Answer the question above first, then reveal the full breakdown to understand why each option is right or wrong.
Correct answer & explanation
✓
vault login -method=ldap username=john
`vault login -method=ldap username=john` is the standard Vault CLI command to authenticate using LDAP credentials. This command triggers the LDAP auth method, prompting the user for their password (or accepting it via `-password` flag) and returning a Vault token upon successful authentication against the configured LDAP server.
Answer analysis
Option-by-option breakdown
For each option: why learners choose it and why it is or isn't the right answer here.
- ✓
vault login -method=ldap username=john
Why this is correct
Correct. vault login -method=ldap is the standard CLI command to authenticate using LDAP credentials. It prompts for the password or accepts the -password flag, and returns a Vault token upon successful authentication.
- ✗
vault token create -policy=ldap
Why it's wrong here
Incorrect. vault token create is used to generate new tokens, not to authenticate with LDAP. The -policy flag specifies policies for the token, but does not perform LDAP login.
- ✗
vault write auth/ldap/login username=john
Why it's wrong here
Incorrect. vault write auth/ldap/login is the raw API endpoint for LDAP login, but the correct CLI command is vault login -method=ldap. The CLI provides a more user-friendly interface.
- ✗
vault auth enable ldap
Why it's wrong here
Incorrect. vault auth enable ldap enables the LDAP authentication method in Vault, but does not perform authentication. It is a prerequisite for using LDAP, not the command to log in.
Go deeper
Related to this question
About these practice questions
This VA-003 question is part of Courseiva's 498-question bank — original exam-style content with full explanations and wrong-answer analysis, never real exam questions or exam dumps. Learn why practice questions differ from exam dumps →
JA
Written by Johnson Ajibi, MSc IT Security
Senior Network & Security Engineer · founder of Courseiva
This VA-003 practice question is part of Courseiva's free HashiCorp certification practice question bank. Courseiva provides original exam-style practice questions with explanations, topic-based practice, mock exams, readiness tracking, and study analytics to help learners prepare for the VA-003 exam.