Certification concept:
The server needs some way to understand the user's identity, once the server knows the user's identity, it can be determined that the user can access the transaction and resources, usually through the user name and password;
HTTP Response/Authentication framework
HTTP Authentication Model:
Challenge/Response Certification framework
Two official authentication protocols for http: Basic authentication and Digest authentication
Four Steps to Certification:
Request: The client initiates a request, and the first request does not have an authentication message;
Challenge: The server challenges the client, returns a 401 unauthorized response, and explains how and where to authenticate in the www-authenticate header ; generally specifies which security domain to authenticate;
Authorization: the client receives 401 challenge, pops up the dialog box, asks the user name and the password, after the user enters the user name and the password, the client uses a colon to connect it, encodes "the scrambling code" the Base-64 representation, It is then put back in the authorization header;
success: The server decodes the user name and password, verifies their correctness, and returns the requested message with an HTTP OK message;
Basic Authentication Example
Basic Certification Header
Base-64 Code:A 8-bit byte sequence is divided into 6-bit chunks, with each 6-bit block selected in a special alphabetical table of 64 characters.
code example
Security Domain:The protected documents are organized into a security domain, each security domain can have a different set of authorized users, and the Realm command will be included in the www-authenticate header;
Security domains on the server
Challenge Response with security domain
Agent Certification
Through the intermediary proxy server to achieve the server internal resources and documents unified access control;
Differences from the Web server
Status code: 407
Header: Proxy
security flaws in Basic authentication:
BASE-64 security is not high, easy to decrypt, use SSL encrypted channel, use Digest authentication;
HTTP Basic Authentication