How to fix Tomcat HTTP Status 403: Access to the requested resource has been denied?

主宰稳场 提交于 2019-11-27 20:55:01

You should choose manager roles which are defined by tomcat instead of admin or manager.

manager-gui - Allows access to the html interface
manager-script - Allows access to the plain text interface
manager-jmx - Allows access to the JMX proxy interface
manager-status - Allows access to the read-only status pages

link to Configuring Manager Application access in tomcat

You need to change the form actions to Post, apparently there is a problem with the GET method on the 6.0.32 version of tomcat, it should be fixed in 6.0.33 version of tomcat.

link to tomcat bugzilla

This one works for me

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

I had the same problem. I needed to do two things. In the web.xml you have to define BASIC or an other method leading to a form based login prompt and a role-name for example Admin:

    <security-constraint>   
    <web-resource-collection>   
        <web-resource-name>Protected Admin Area</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>
  </login-config>  

In the tomcat-users.xml add a user with the role Admin, or if you use a graphic interface like eclipse do the following:

Manoj Mudaliyar

Please check you web.xml In that put

admin instead of AllAuthenticatedUsers in <role-name>AllAuthenticatedUser</role-name>

Just try this and let me know whether it worked or not.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!