[英]Exclude one jsf page from login authentication
我正在尝试从登录身份验证中排除一个JSF页面。 我在web.xml中添加了一个没有auth-constraint标记的安全约束,如此处建议的那样: https : //blog.mafr.de/2011/04/17/clusion-pages-from-auth/
这不能解决问题,因为我使用的是基于web.xml中配置的基于容器的登录配置。
是否有一种方法可以仅保留一个JSF页面而无需登录,同时又保持当前的登录配置?
这是我的登录和安全约束配置:
<security-constraint>
<web-resource-collection>
<web-resource-name>Restricted Employees</web-resource-name>
<url-pattern>/employee</url-pattern>
<http-method>POST</http-method>
<http-method>GET</http-method>
</web-resource-collection>
<auth-constraint>
<role-name>team_leaders</role-name>
</auth-constraint>
</security-constraint>
<security-constraint>
<web-resource-collection>
<web-resource-name>Public</web-resource-name>
<description>No login required for accepting requests</description>
<url-pattern>/acceptRequests</url-pattern>
<http-method>POST</http-method>
<http-method>GET</http-method>
</web-resource-collection>
</security-constraint>
<login-config>
<auth-method>FORM</auth-method>
<form-login-config>
<form-login-page>/login.xhtml</form-login-page>
<form-error-page>/login.xhtml</form-error-page>
</form-login-config>
</login-config>
原来没有使用web.xml中的配置,并且有一个提供授权的过滤器类。 它仅限于xhtml文件,所以这就是为什么我对html文件没有问题的原因。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.