Bird
0
0

Identify the error in this Authorization header: 'Authorization: Basic YWRtaW4xMjM0'.

medium📝 Debug Q6 of 15
Rest API - Authentication and Authorization
Identify the error in this Authorization header: 'Authorization: Basic YWRtaW4xMjM0'.
AThe header is missing the username
BThe base64 string is incorrect; it should encode 'admin:1234'
CThe header should use 'Bearer' instead of 'Basic'
DThe header is missing the password
Step-by-Step Solution
Solution:
  1. Step 1: Decode the base64 string

    Decoding 'YWRtaW4xMjM0' does not produce 'admin:1234'.
  2. Step 2: Confirm correct encoding

    The correct base64 for 'admin:1234' is 'YWRtaW46MTIzNA==', so the string is wrong.
  3. Final Answer:

    The base64 string is incorrect; it should encode 'admin:1234' -> Option B
  4. Quick Check:

    Incorrect base64 encoding = Error in header [OK]
Quick Trick: Check base64 encoding matches 'username:password' exactly [OK]
Common Mistakes:
  • Using wrong base64 string
  • Mixing up Bearer and Basic
  • Assuming partial encoding is valid

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Rest API Quizzes