Inordere to implement BASIC authentication having following configurationPutting this in tomcat user.xml
<role rolename="Admin"/>
<role rolename="Member"/>
<role rolename="Guest"/>
<user username="admin1" password="admin1" roles="Admin,Member,Guest"/>
<user username="knroy" password="knroy" roles="Member"/>
<user username="guest1" password="guest1" roles="Guest"/>
putting this in myproject1--->web.xml
<security-role>
<role-name>Admin</role-name>
</security-role>
<security-role>
<role-name>Member</role-name>
</security-role>
<security-role>
<role-name>Guest</role-name>
</security-role>
<security-constraint>
<web-resource-collection>
<web-resource-name>
Testing</web-resource-name>
<url-pattern>/validate/*</url-pattern>
<http-method>GET</http-method>
<http-method>POST</http-method>
</web-resource-collection>
<auth-constraint>
<role-name>Admin</role-name>
<role-name>Member</role-name>
</auth-constraint>
</security-constraint>
<login-config>
<auth-method>BASIC</auth-method>
</login-config>
and restart tomcat 6 ----->run Project---> asking login prompt---->username: admin1 password:admin1--->HTTP 401 error
[ Under Windows XP with running in localhost:8080 ]
Why it is not working despite follwing all the steps as mentioned above