Introduction to authentication mechanisms

The authentication mechanisms supported natively in the HTTP protocol are HTTP basic and HTTP digest. Both mechanisms are supported in Python through the requests library. The HTTP Basic Authentication mechanism is based on forms and uses Base64 to encode the user composed with the password separated by a colon: user: password.

The HTTP Digest Authentication mechanism uses MD5 to encrypt the user, key, and realm hashes. The main difference between both methods is that basic only encodes without actually encrypting, while digest encrypts the user's information in MD5 format.

With the Requests module, we can connect with servers that support Basic and Digest Authentication. With Basic Authentication, the information about the user and password is sent in Base64 format, and with Digest the information about the user and password is sent as a hash using the MD5 or SHA1 algorithms.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset