Wie konfiguriere ich tomcat-users.xml, um eine Seite in tomcat zu schützen?
Ich versuche meine Admin-Seiten in Tomcat mit zu sichernweb.xml
undtomcat-users.xml
aber es funktioniert nicht. Das Anmeldeformular wird angezeigt, die Verbindung ist jedoch nicht möglich
Hier ist derweb.xml
in meinem web / WEB_INF Ordner:
<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>
<realm-name>Admin</realm-name>
</login-config>
Undtomcat-users.xml
im server / tomcat / conf / ordner:
<tomcat-users>
<role rolename="manager"/>
<role rolename="tomcat"/>
<role rolename="admin"/>
<role rolename="role1"/>
<user username="manager" password="manager" roles="manager"/>
<user username="both" password="tomcat" roles="tomcat,role1"/>
<user username="tomcat" password="tomcat" roles="tomcat"/>
<user username="role1" password="tomcat" roles="role1"/>
<user username="admin" password="admin" roles="admin"/>
</tomcat-users>
Irgendeine Idee ?