Rest API - Authentication and AuthorizationIdentify the error in this Authorization header: 'Authorization: Basic YWRtaW4xMjM0'.AThe header is missing the usernameBThe base64 string is incorrect; it should encode 'admin:1234'CThe header should use 'Bearer' instead of 'Basic'DThe header is missing the passwordCheck Answer
Step-by-Step SolutionSolution:Step 1: Decode the base64 stringDecoding 'YWRtaW4xMjM0' does not produce 'admin:1234'.Step 2: Confirm correct encodingThe correct base64 for 'admin:1234' is 'YWRtaW46MTIzNA==', so the string is wrong.Final Answer:The base64 string is incorrect; it should encode 'admin:1234' -> Option BQuick Check:Incorrect base64 encoding = Error in header [OK]Quick Trick: Check base64 encoding matches 'username:password' exactly [OK]Common Mistakes:Using wrong base64 stringMixing up Bearer and BasicAssuming partial encoding is valid
Master "Authentication and Authorization" in Rest API9 interactive learning modes - each teaches the same concept differentlyLearnWhyDeepVisualTryChallengeProjectRecallTime
More Rest API Quizzes Authentication and Authorization - JWT structure and flow - Quiz 3easy Error Handling - Nested error reporting - Quiz 14medium Error Handling - Validation error details - Quiz 7medium Error Handling - Nested error reporting - Quiz 13medium Error Handling - Validation error details - Quiz 3easy HATEOAS and Linking - Action links for state transitions - Quiz 5medium HATEOAS and Linking - HAL format overview - Quiz 12easy Pagination Patterns - Offset-based pagination - Quiz 13medium Pagination Patterns - Offset-based pagination - Quiz 14medium Rate Limiting and Throttling - Rate limit headers (X-RateLimit) - Quiz 13medium