Challenge - 5 Problems
Basic Auth Master
Get all challenges correct to earn this badge!
Test your skills under time pressure!
🧠 Conceptual
intermediate1:30remaining
What does Basic Authentication encode?
In Basic Authentication, what is the format of the encoded string sent in the Authorization header?
Attempts:
2 left
💡 Hint
Think about how username and password are combined before encoding.
✗ Incorrect
Basic Authentication sends the username and password joined by a colon, then encoded in Base64. This string is sent in the Authorization header.
❓ Predict Output
intermediate2:00remaining
What is the Authorization header value?
Given username 'user1' and password 'pass123', what is the correct Authorization header value in Basic Authentication?
Postman
import base64 credentials = 'user1:pass123' encoded = base64.b64encode(credentials.encode()).decode() print(f'Basic {encoded}')
Attempts:
2 left
💡 Hint
Check the exact Base64 encoding of 'user1:pass123'.
✗ Incorrect
The string 'user1:pass123' encoded in Base64 is 'dXNlcjE6cGFzczEyMw=='. The Authorization header must be 'Basic ' plus this string.
❓ locator
advanced1:30remaining
Identify the correct Postman setting for Basic Auth
Where in Postman do you set the username and password for Basic Authentication?
Attempts:
2 left
💡 Hint
Postman has a dedicated place for authentication types.
✗ Incorrect
Postman provides an Authorization tab where you can select Basic Auth and enter credentials. It automatically encodes and adds the header.
❓ assertion
advanced1:30remaining
Which test script assertion verifies Basic Auth success?
In Postman test scripts, which assertion correctly checks that the server accepted Basic Authentication by returning status 200?
Postman
pm.test('Basic Auth success', () => { pm.response.to.have.status(200); });
Attempts:
2 left
💡 Hint
Success means HTTP 200 OK status.
✗ Incorrect
A 200 status code means the server accepted the credentials and authorized the request.
🔧 Debug
expert2:30remaining
Why does this Postman Basic Auth test fail?
This Postman test script fails even though the username and password are correct. What is the likely cause?
pm.test('Check Auth', () => {
pm.response.to.have.status(200);
pm.expect(pm.request.headers.get('Authorization')).to.eql('Basic dXNlcjE6cGFzczEyMw==');
});
Attempts:
2 left
💡 Hint
Check how the Authorization header is accessed and compared in the test.
✗ Incorrect
The test compares the Authorization header to a hardcoded string. If credentials change or encoding differs, the test fails. It's better to dynamically check or decode the header.