Security & CryptoLesson 345Free preview
Basic Auth Header Generator
This lesson is part of Web Developer Tools · All levels
Summary
HTTP Basic Authentication sends the username and password in the Authorization header in the Base64 format from username:password. Base64 is just encoding, not encryption, so credentials can be read if the connection is unsafe. That's why Basic Auth is only suitable for use over HTTPS or for simple internal needs.
Key points
- The credential format is Base64(username:password)
- The header used is Authorization: Basic...
- Base64 can be decoded easily, so HTTPS is mandatory.
- The server responds 401 with WWW-Authenticate to request credentials
- For public applications, tokens or OAuth are more flexible than Basic Auth
Full lesson
Code examples and quizzes
Full lessons, code examples, and quizzes are available to subscribers. 5 questions.