views:

473

answers:

1

The problem

A tomcat manager page can not be accessed by a user granted a manager role.

The things I tryed to do

I added a user with a manager role into tomcat-users.xml:

<role rolename="manager"/>
<user username="emanemos" password="password" roles="manager"/>

I also looked up the $CATALINA_HOME/webapps/manager/WEB-INF/web.xml to be sure that manager role is really used to access the application:

<auth-constraint>
  <!-- NOTE:  This role is not present in the default users file -->
  <role-name>manager</role-name>
</auth-constraint>

<!-- Define the Login Configuration for this Application -->
<login-config>
  <auth-method>BASIC</auth-method>
  <realm-name>Tomcat Manager Application</realm-name>
</login-config>

<!-- Security roles referenced by this web application -->
<security-role>
  <description>
    The role that is required to log in to the Manager Application
  </description>
  <role-name>manager</role-name>
</security-role>

However, the manager application still asks for a login-password pair in an endless loop ignoring my input.

Does anybody have any ideas?

A: 

Did you restart Tomcat after making the changes to tomcat-users.xml?

Simon Groenewolt
Yes, I did restart Tomcat.
emanemos
Hmm, it worked just fine for me. You might have edited a tomcat-users.xml that is not actually used by the tomcat that you see when trying to log in. Easiest way to verify is to shut the tomcat server down and to check if it is in fact no longer accessible. Another thing would be to check the catalina.out and other logfiles in the logs dir - they should show the tomcat starting up, if anything is wrong it should be printed there. Last resort would be to try a fresh download of the tomcat zip, maybe something really really really weird happened.
Simon Groenewolt
It was the weird thing, something like dark spirit. I've reinstalled my tomcat and the problem seems to disappear. Thank you for trying to help, Simon.
emanemos