1
我用邮差4.4.1在Chrome 51.0.2704.63.I已经成立了一个的tomcat6 web项目,在web.xml,如:邮差摘要授权请求返回401 Unauthrized
<web-app>
<display-name>Archetype Created Web Application</display-name>
<security-constraint>
<web-resource-collection>
<web-resource-name>
My App
</web-resource-name>
<url-pattern>/*</url-pattern>
</web-resource-collection>
<auth-constraint>
<role-name>tomcat</role-name>
</auth-constraint>
</security-constraint>
<login-config>
<auth-method>DIGEST</auth-method> <!-- DIGEST here -->
<realm-name>My Realm</realm-name>
</login-config>
</web-app>
当我访问http://localhost:8080/simple-web/使用我的本地浏览器,弹出一个窗口让我输入用户名和密码。填好后,效果很好。 当我使用邮递员时,我在授权页面中输入用户名和密码,然后选择带有Digest Auth
的类型。它总是向我显示401 Unauthrized。 我可以看到头:
Cache-Control →no-cache
Content-Length →954
Content-Type →text/html;charset=utf-8
Date →Fri, 29 Jul 2016 10:26:20 GMT
Expires →Thu, 01 Jan 1970 08:00:00 CST
Pragma →No-cache
Server →Apache-Coyote/1.1
WWW-Authenticate →Digest realm="My Realm", qop="auth", nonce="dcb71e7d6766f85c3f233b7b74e42423", opaque="4894d1ece1380278a451585e9b548e21"
能有人知道的原因,以及如何解决它?