Learning Python Networking - Second Edition
by José Manuel Ortega, Dr. M. O. Faruque Sarker, Sam Washington
HTTP Basic authentication
Basic access authentication assumes that the client will be identified by a username and a password. When the browser client initially accesses a site using this system, the server replies with a response of type 401, which contains the WWW-Authenticate tag with the Basic value and the name of the protected domain (such as WWW-Authenticate: Basic realm = "www.domainProtected.com").
The browser responds to the server with an Authorization tag, which contains the Basic value and the concatenation in the Base64 encoding of the login, the colon punctuation mark :, and the password (for example, Authorization : Basic b3dhc3A6cGFzc3dvcmQ =). Assuming that we have a URL protected with this type of authentication, in Python, ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access