http://en.wikipedia.org/wiki/Digest_access_authentication
基本原理:
1.客户端根据服务器端生成的nonce值 加上用户名和密码取MD5值,将这个值发送给服务器端,服务器端验证该值是否合法
具体请看http://en.wikipedia.org/wiki/Digest_access_authentication
HTTPLOOK本地抓包测试,服务器端用户名 tomcat,密码 tomcat
GET /club-test/IndexServlet HTTP/1.1
Accept: */*
Accept-Language: zh-cn
Accept-Encoding: gzip, deflate
User-Agent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; TCO_20100513102058; .NET CLR 2.0.50727; .NET CLR 3.0.04506.30; CIBA; .NET CLR 3.0.4506.2152; .NET CLR 3.5.30729)
Host: 127.0.0.1:8080
Connection: Keep-Alive
HTTP/1.1 401 Unauthorized
Server: Apache-Coyote/1.1
Pragma: No-cache
Cache-Control: no-cache
Expires: Thu, 01 Jan 1970 08:00:00 CST
WWW-Authenticate: Digest realm="Basic Authentication Area", qop="auth", nonce="8746947a93be8d88219ab22dccc5e3e6", opaque="4334df1313fb0e562393efeaff630d18"
Content-Type: text/html;charset=utf-8
Content-Length: 954
Date: Thu, 13 May 2010 02:22:43 GMT
GET /club-test/IndexServlet HTTP/1.1
Accept: */*
Accept-Language: zh-cn
Accept-Encoding: gzip, deflate
User-Agent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; TCO_20100513102058; .NET CLR 2.0.50727; .NET CLR 3.0.04506.30; CIBA; .NET CLR 3.0.4506.2152; .NET CLR 3.5.30729)
Host: 127.0.0.1:8080
Connection: Keep-Alive
Authorization: Digest username="tomcat", realm="Basic Authentication Area", qop="auth", algorithm="MD5", uri="/club-test/IndexServlet", nonce="8746947a93be8d88219ab22dccc5e3e6", nc=00000001, cnonce="63594dae28ab96e3bd3fc7e3fabca0d8", opaque="4334df1313fb0e562393efeaff630d18", response="627bf900cec889712184f0e21fcef80e"
HTTP/1.1 200 OK
Server: Apache-Coyote/1.1
Pragma: No-cache
Cache-Control: no-cache
Expires: Thu, 01 Jan 1970 08:00:00 CST
Set-Cookie: JSESSIONID=B235CF234E263363B7F46DC4DF6D23BD; Path=/club-test
Transfer-Encoding: chunked
Date: Thu, 13 May 2010 02:22:57 GMT
GET /club-test/Music HTTP/1.1
Accept: image/gif, image/x-xbitmap, image/jpeg, image/pjpeg, application/xaml+xml, application/vnd.ms-xpsdocument, application/x-ms-xbap, application/x-ms-application, application/x-shockwave-flash, application/vnd.ms-excel, application/vnd.ms-powerpoint, application/msword, */*
Accept-Language: zh-cn
Accept-Encoding: gzip, deflate
User-Agent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; TCO_20100513102058; .NET CLR 2.0.50727; .NET CLR 3.0.04506.30; CIBA; .NET CLR 3.0.4506.2152; .NET CLR 3.5.30729)
Host: 127.0.0.1:8080
Connection: Keep-Alive
Cookie: JSESSIONID=B235CF234E263363B7F46DC4DF6D23BD
Authorization: Digest username="tomcat", realm="Basic Authentication Area", qop="auth", algorithm="MD5", uri="/club-test/Music", nonce="8746947a93be8d88219ab22dccc5e3e6", nc=00000002, cnonce="cd29e5745208fc6b4e7d0b86770c81ca", response="bb1c27f7a0f955967541c46090add6e8"
分享到:
相关推荐
HTTP Security: Digest Access Authentication
RFC2617-cn.pdf HTTP Authentication: Basic and Digest Access Authentication
9. Basic(基本)和Digest(摘要)验证 9.1. BasicAuthenticationFilter 9.1.1. 配置 9.2. DigestAuthenticationFilter 9.2.1. Configuration 10. Remember-Me 认证 10.1. 概述 10.2. 简单基于散列...
-Basic and Digest authentication -Multiple (url-encoded and multipart/form-data) form types -Automatic redirection handling -Upload and Download progress tracking -Access your data while downloading -...
Contents About the Author...............................................................................................xix About the Technical Reviewer and Contributing Author.................xxi ...
9. Basic(基本)和Digest(摘要)验证 9.1. BasicAuthenticationFilter 9.1.1. 配置 9.2. DigestAuthenticationFilter 9.2.1. Configuration 10. Remember-Me认证 10.1. 概述 10.2. 简单基于散列标记的方法 ...
9. Basic(基本)和Digest(摘要)验证 9.1. BasicAuthenticationFilter 9.1.1. 配置 9.2. DigestAuthenticationFilter 9.2.1. Configuration 10. Remember-Me认证 10.1. 概述 10.2. 简单基于散列标记...
String identifier for Digest authentication. doDelete(HttpServletRequest, HttpServletResponse) - Method in class javax.servlet.http.HttpServlet Called by the server (via the service method) to allow...
6. 基本设置命令 任务 命令 全局设置 config terminal 设置访问用户及密码 username username password password 设置特权密码 enable secret password 设置路由器名 hostname name 设置静态路由 ip route ...
Physical Access Section 10.10. Biometrics Section 10.11. Homework Chapter 11. Security Handshake Pitfalls Section 11.1. Login Only Section 11.2. Mutual Authentication Section 11.3. ...
Python参考手册,官方正式版参考手册,chm版。以下摘取部分内容:Navigation index modules | next | Python » 3.6.5 Documentation » Python Documentation contents What’s New in Python ...
http认证用于HTTP基本和摘要访问身份验证的软件包。安装通过git(或下载的tarball): $ git clone git...// Authentication module.const auth = require ( "http-auth" ) ;const basic = auth . basic ( { realm : "S
* Supports HTTP Basic and Digest authentication (client and server side) * Supports Amazon S3 authentication (client side) * Supports OAuth authentication (server side) * Supports HTTPS ...
powerful delegations it is able to let you use it for any kind of files, ie it can also digest manual pages, dvi files, texinfo, .... Among the other most noticeable features of a2ps are: − various ...
ICS - Internet Component Suite - V8 - Delphi 7 to RAD Studio 10 Seattle ======================================================================= (Aka FPIETTE's Components) Revised: March 3, 2016 ...
area 0 authentication message-digest network x.x.0.0 0.0.255.255 area 0 (3)不匹配的区域ID——区域信息在OSPF的HELLO分组中发送。不同,不会形成邻接。 (4)不匹配的短截/传输/NSSA区域选项——...
Writing Access with Prototypes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 47 Objects Can Extend Objects . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 48 Prototypal ...