8
我配置了tomcat进行基本身份验证。 我不希望任何人访问我的Web应用程序,但该应用程序正在提供Web服务。 所以我想从基本身份验证绕过特定的IP地址(即IP不应该要求身份验证。)Tomcat:绕过指定IP地址的基本身份验证
的tomcat-users.xml中:
<tomcat-users>
<user username="user" password="password" roles="user"/>
</tomcat-users>
的web.xml:
<security-constraint>
<web-resource-collection>
<web-resource-name>Entire Application</web-resource-name>
<url-pattern>/*</url-pattern>
</web-resource-collection>
<auth-constraint>
<role-name>user</role-name>
</auth-constraint>
</security-constraint>
<login-config>
<auth-method>BASIC</auth-method>
<realm-name>You must enter your login credentials to continue</realm-name>
</login-config>
<security-role>
<description>
The role that is required to log in to the Application
</description>
<role-name>user</role-name>
</security-role>
谢谢, Chetan。
谢谢palacsinit,我会尝试添加此功能,并且会尽快发布结果。 – Chetan
它工作完美,非常感谢palacsint。 – Chetan