The process of authenticating an HTTP request by Apache2.4/HTTPD
http的认证请求过程梳理,英文描述,后续慢慢补充修改。
流程图用UML简单画的:
【The process of authenticating an HTTP request by Apache2.4/HTTPD.】
While some web client today defer to another service to handle the authentication,most still support a form based authentication by default.
The process :
The first,Client sends a TCP SYNchronize packet to Server
Server receives Client's SYN
Server sends a SYNchronize-ACKnowledgement
Client receives Server's SYN-ACK
Client sends ACKnowledge
Serverreceives ACK.
TCP socket connection is ESTABLISHED.
During the registration, the password is sent (ideally over HTTPS) to the server.
This password is then salted and hashed using bcrypt (or equivalent) and stored for further use by the server.
A salt known only by this application instance is used to prevent brute force in case the password’s hashes
get leaked (via a sql injection for example).
During login is sent in a similar fashion than the setup,
the server hash it and compare it with the stored version.
If they match the server store a session token that is send back as a cookie (or url parameter)
and set on the client side. This cookie is produced by the client for each requests for the duration
of the session (until the cookie expires, the user logout or the server terminate the session).