我已将 SQLLoginModule 添加到我的部署中(TomEE 1.5.1):
- 指向 login.config 的系统属性
- login.config 配置为使用 SQLLogin 领域
- server.xml 更新为使用此领域
这是 web.xml (我几乎可以肯定问题出在这里)
<security-constraint>
<display-name>Unsecured</display-name>
<web-resource-collection>
<web-resource-name>Unsecured area</web-resource-name>
<url-pattern>/login.html</url-pattern>
</web-resource-collection>
<user-data-constraint>
<transport-guarantee>CONFIDENTIAL</transport-guarantee>
</user-data-constraint>
</security-constraint>
<security-constraint>
<web-resource-collection>
<web-resource-name>Entire Application</web-resource-name>
<url-pattern>*.html</url-pattern>
</web-resource-collection>
<auth-constraint>
<role-name>ADMIN</role-name>
<role-name>SUPERUSER</role-name>
<role-name>USER</role-name>
</auth-constraint>
<user-data-constraint>
<transport-guarantee>CONFIDENTIAL</transport-guarantee>
</user-data-constraint>
</security-constraint>
<security-role>
<role-name>ADMIN</role-name>
</security-role>
<security-role>
<role-name>SUPERUSER</role-name>
</security-role>
<security-role>
<role-name>USER</role-name>
</security-role>
<login-config>
<auth-method>FORM</auth-method>
<realm-name>SQLLogin</realm-name>
<form-login-config>
<form-login-page>/login.html</form-login-page>
<form-error-page>/login.html</form-error-page>
</form-login-config>
</login-config>
<welcome-file-list>
<welcome-file>testRest.html</welcome-file>
</welcome-file-list>
部署和登录时,我什org.apache.openejb.core.security.jaas.SQLLoginModule
至毫无例外地进行了远程调试,但由于某种原因,重定向到欢迎文件失败,并且出现 403 access-denied 错误。
有什么想法吗?