HTTP Digest Authentication
1. HTTP Digest Authentication
The HTTP Digest Authentication technique is an authentication technique for improving the security weaknesses of the HTTP Basic authentication technique. [Figure 1] shows an Example of the HTTP Digest authentication technique.
![[Figure 1] HTTP Digest Authentication](/blog-software/docs/theory-analysis/http-digest-authorization/images/http-digest-example.png)
[Figure 1] HTTP Digest Authentication
- The Client requests a Resource from the Server.
- Authentication is required to use the Resource requested by the Client. Therefore, the Server informs the Client of the need for authentication through the
WWW-AuthenticateHeader. TheDigeststring informs the Client that the Digest authentication process is required.realmis an attribute that indicates the Protection Space of the requested Resource. The Client may use a different ID and Password for each Protection Space that a Resource belongs to.nonceis a random value generated by the Server every time the Client requests a Resource from the Server. The Client must deliver thenoncereceived from the Server back to the Server as-is. The Server rejects the Resource request if thenoncediffers. Therefore,noncecan prevent Server Replay Attacks.qopstands for Quality of protection and, as its name implies, indicates the Protection level.
- The Client that receives the authentication request adds the
nonce,qop, andrealmattribute values received from the Server to theAuthorizationHeader as-is, and adds the other necessary attribute values.ncstands for nonce count and indicates how many times the Client has made requests to the Server using thenoncereceived from the Server.cnonceis a random value generated by the Client. Similar tononce, it prevents Client Replay Attacks.responseis a Digest that contains the information required for authentication.responseis obtained through [Formula 1].
| |
- When the Server confirms that the
nonceandresponsematch, it sends authentication information through theAuthorization-InfoHeader along with the Resource requested by the Client.qopindicates the Protection level used by the Server.ncandcnoncemust match the values sent by the client.rspauthmeans response auth and is used for mutual authentication between the Server and the Client.nextnonceindicates thenoncevalue that the Server wants the Client to use in its next request.
By Encoding the Password with MD5, the security weakness of Basic authentication is complemented. In addition, by utilizing the randomly issued nonce value not only for Data but also beyond it, the Server and the Client themselves can be protected.
2. References
- HTTP Digest Authentication Scheme : https://tools.ietf.org/html/rfc2069
- Supporting HTTP Authentication and Forms Authentication in a Single ASP.NET Web Site : https://msdn.microsoft.com/en-us/library/aa479391.aspx
- Digest Authentication Technical Reference : https://technet.microsoft.com/en-us/library/cc780170(v=ws.10).aspx
- Digest Authentication with ASP.NET Web API (Part 1) : https://lbadri.wordpress.com/2012/08/10/digest-authentication-with-asp-net-web-api-part-1/
- [HTTP] Digest Authentication : http://iloveulhj.github.io/posts/http/http-digest-auth.html
- HTTP Digest Authentication : http://flylib.com/books/en/1.2.1.123/1/