Bird
Raised Fist0

What will be the result of this curl command if the credentials are correct?

medium📝 Predict Output Q13 of Q15
Elasticsearch - Security
What will be the result of this curl command if the credentials are correct?
curl -u elastic:changeme -X GET "localhost:9200/_security/_authenticate"
AAn error message saying 'Unauthorized'
BA JSON response with user details and roles
CA list of all indices in the cluster
DA blank response with status 200
Step-by-Step Solution
Solution:
  1. Step 1: Understand the curl command

    The command uses basic auth with username 'elastic' and password 'changeme' to call the authenticate API.
  2. Step 2: Predict the API response on correct credentials

    If credentials are correct, the API returns JSON with user info and roles, not errors or unrelated data.
  3. Final Answer:

    A JSON response with user details and roles -> Option B
  4. Quick Check:

    Correct credentials = user info JSON [OK]
Quick Trick: Correct credentials return user info JSON [OK]
Common Mistakes:
MISTAKES
  • Expecting an error with correct credentials
  • Confusing authenticate API with index listing
  • Assuming blank response means success

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Elasticsearch Quizzes