Bird
0
0

Given the username 'user' and password 'pass', what is the value of the Authorization header in Basic Authentication?

medium📝 Predict Output Q13 of 15
Rest API - Authentication and Authorization
Given the username 'user' and password 'pass', what is the value of the Authorization header in Basic Authentication?
AAuthorization: Basic dXNlcjpwYXNz
BAuthorization: Basic dXNlcjpwYXNzCg==
CAuthorization: Basic dXNlcjpwYXNzdA==
DAuthorization: Basic dXNlcjpwYXNzZA==
Step-by-Step Solution
Solution:
  1. Step 1: Combine username and password with colon

    Combine 'user' and 'pass' as 'user:pass'.
  2. Step 2: Encode 'user:pass' in base64

    Encoding 'user:pass' in base64 results in 'dXNlcjpwYXNzdA=='.
  3. Final Answer:

    Authorization: Basic dXNlcjpwYXNzdA== -> Option C
  4. Quick Check:

    Base64('user:pass') = dXNlcjpwYXNzdA== [OK]
Quick Trick: Encode 'username:password' in base64 for header value [OK]
Common Mistakes:
  • Encoding username and password separately
  • Adding extra characters or padding incorrectly
  • Using wrong base64 string

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Rest API Quizzes