0
我正在尝试为我的Web应用程序(主要设置数据库)编写基于Web的安装程序。 但是因为我使用所有Servlets的DIGEST身份验证,所以我在那里遇到问题。 我希望能够让用户输入他的mysql密码,但他不能,因为他无法登录。由于用户在数据库中保存的,这并不在这一点上存在,就没有办法登录。改写Tomcat基本身份验证
<security-constraint>
<web-resource-collection>
<web-resource-name>Wildcard means whole app requires authentication</web-resource-name>
<url-pattern>/*</url-pattern>
<http-method>GET</http-method>
<http-method>POST</http-method>
</web-resource-collection>
<auth-constraint>
<role-name>crm_user</role-name>
</auth-constraint>
<user-data-constraint>
<transport-guarantee>NONE</transport-guarantee>
</user-data-constraint>
</security-constraint>
<login-config>
<auth-method>DIGEST</auth-method>
<realm-name>tomcat_realm</realm-name>
</login-config>
我可以覆盖一个单独的servlet登录配置,因此用户不必输入密码?
我知道,但我的程序有超过一百个Servlets,我不喜欢将它们全部映射的想法。没有办法给规则添加一个异常? – Kendoha 2014-12-04 11:03:44
@Kendoha我编辑了答案,以包含一个不需要通过链接指向示例来更改现有安全约束的选项。 – Rob 2014-12-04 15:23:19
非常感谢你,我会尝试 – Kendoha 2014-12-05 06:49:57