Courseiva

VA-003 Utilize Vault CLI and API Practice Question

A user wants to log in using the userpass auth method with username 'jdoe' and password 'p@ssw0rd'. What is the correct API endpoint and request?

⚠ Common exam trap

HashiCorp often tests the misconception that authentication requests can use GET or PUT methods or pass credentials in headers or query parameters, when Vault strictly requires POST with a JSON body for login endpoints.

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

✓

POST /v1/auth/userpass/login/jdoe with JSON body {"password":"p@ssw0rd"}

The userpass auth method in Vault requires a POST request to the login endpoint with the password provided in the JSON body. Option D correctly uses POST /v1/auth/userpass/login/jdoe with {"password":"p@ssw0rd"}, which matches the Vault API specification for authenticating against a userpass backend.

Answer analysis

Option-by-option breakdown

For each option: why learners choose it and why it is or isn't the right answer here.

  • ✗

    GET /v1/auth/userpass/login/jdoe with header "password: p@ssw0rd"

    Why it's wrong here

    The userpass login endpoint requires a POST with the password in the JSON request body; GET with a password header is rejected. It is tempting because the path looks correct. POST /v1/auth/userpass/login/jdoe with {"password":"p@ssw0rd"} is the correct call.

  • ✗

    PUT /v1/auth/userpass/login/jdoe with JSON body {"password":"p@ssw0rd"}

    Why it's wrong here

    Vault's userpass login endpoint accepts POST, not PUT; PUT returns a 405 method-not-allowed error, so authentication fails. PUT is tempting because it implies creating a session token, and would fit endpoints that genuinely create or replace a named resource, such as writing a policy at a specific path.

  • ✗

    POST /v1/auth/userpass/login/jdoe?password=p@ssw0rd

    Why it's wrong here

    Vault's userpass login expects the password in the JSON request body, not as a URL query parameter, and the call must be a POST. It is tempting because the path is right. POST /v1/auth/userpass/login/jdoe with {"password":"p@ssw0rd"} is correct.

  • ✓

    POST /v1/auth/userpass/login/jdoe with JSON body {"password":"p@ssw0rd"}

    Why this is correct

    The userpass auth method exposes a login endpoint scoped to the specific username, so the credential travels in the JSON body rather than the path. POST /v1/auth/userpass/login/jdoe satisfies the stem's requirement to authenticate jdoe with the supplied password, returning a Vault token on success.

About these practice questions

This VA-003 question is part of Courseiva's 366-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 →

How Courseiva writes practice questions · Editorial policy

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.