I\'m trying to secure my admin pages in tomcat with web.xml and tomcat-users.xml but it\'s not working. The login form appears but connection is im
Probably late to answer but anyways You are missing role in in you web.xml and also dont have to mention realm hence you web.xml should look like as follows
<security-constraint>
<web-resource-collection>
<web-resource-name>Admin</web-resource-name>
<url-pattern>/admin/*</url-pattern>
</web-resource-collection>
<auth-constraint>
<role-name>admin</role-name>
</auth-constraint>
</security-constraint>
<login-config>
<auth-method>BASIC</auth-method>
<!-- Please note following line .. its commented -->
<!-- <realm-name>Admin</realm-name> -->
</login-config>
<!-- Following section was missing -->
<security-role>
<role-name>admin</role-name>
</security-role>