如何为所有URL应用tomcat安全角色而不是一个?

pet*_*erp 7 security tomcat web.xml

我的管理Web应用程序使用basic-auth以下方

<security-constraint>
  <web-resource-collection>
    <web-resource-name>myApp</web-resource-name>
    <description>
      Security constraint for
      Admin resources
    </description>
    <url-pattern>/*</url-pattern>
    <http-method>POST</http-method>
    <http-method>GET</http-method>
  </web-resource-collection>
  <auth-constraint>
    <description>
      constraint
    </description>
    <role-name>myrolename</role-name>
  </auth-constraint>
  <user-data-constraint>
    <description>SSL not required</description>
    <transport-guarantee>NONE</transport-guarantee>
  </user-data-constraint>
</security-constraint>
<login-config>
  <auth-method>BASIC</auth-method>
  <realm-name>Admin Login</realm-name>
</login-config>
Run Code Online (Sandbox Code Playgroud)

但是,我需要为单个URL建立排除(例如/ check /,由自动服务使用,检查Web应用程序是否仍然定期运行.

不幸的是,我无法为此服务激活基本身份验证.

我怎么能做到这一点?

非常感谢.

pet*_*erp 7

之前添加另一个约束就可以<transport-guarantee>NONE</transport-guarantee>

<security-constraint>
    <web-resource-collection>
        <web-resource-name>Status page, accessed internally by application</web-resource-name>
        <url-pattern>/status/</url-pattern>
    </web-resource-collection>
    <user-data-constraint>
        <transport-guarantee>NONE</transport-guarantee>
    </user-data-constraint>
</security-constraint>
Run Code Online (Sandbox Code Playgroud)