I use Postman 4.4.1 in Chrome 51.0.2704.63.I have set up a web project with Tomcat6, the web.xml like:
<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>
When I access http://localhost:8080/simple-web/ use my local browser, a window pops up to let me input username and password. After fill, it works well.
When I use Postman, I input the username and password in Authorization Page, and choose the Type with Digest Auth
.It always shows to me 401 Unauthrized.
I can see the Headers:
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"
Can someone knows the reason and how to fix it?