我在使用基于容器的安全系统时遇到了问题。就我禁用prettyfaces (在pom.xml中删除它的存在)而言,基于容器的安全性运行良好,页面也很安全。但是,通过使用prettyfaces,安全性不再起作用,而且安全的页面无需身份验证就可以访问(我没有在受保护的页面上应用漂亮的faces过滤器)。即使在使用空的漂亮-config.xml(唯一的)时也是如此。
我在用Jboss作为
编辑:
使用此设置,不需要身份验证就可以访问页/user/*。在从pom.xml中删除前面板之后,它工作得很好。
Web.xml的一部分:
<security-role>
<description>Users</description>
<role-name>user</role-name>
</security-role>
<security-constraint>
<web-resource-collection>
<web-resource-name>General use.</web-resource-name>
<url-pattern>/user/*</url-pattern>
<http-method>DELETE</http-method>
<http-method>GET</http-method>
<http-method>POST</http-method>
<http-method>PUT</http-method>
<http-method>HEAD</http-method>
<http-method>TRACE</http-method>
<http-method>OPTIONS</http-method>
</web-resource-collection>
<auth-constraint>
<role-name>user</role-name>
</auth-constraint>
<user-data-constraint>
<transport-guarantee>NONE</transport-guarantee>
</user-data-constraint>
</security-constraint>
<login-config>
<auth-method>FORM</auth-method>
<form-login-config>
<form-login-page>/login.xhtml</form-login-page>
<form-error-page>/login-fail.xhtml</form-error-page>
</form-login-config>
</login-config>prettyfaces-config.xml (当使用空的_(当使用空的_
<pretty-config xmlns="http://ocpsoft.org/schema/rewrite-config-prettyfaces"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://ocpsoft.org/schema/rewrite-config-prettyfaces
http://ocpsoft.org/xml/ns/prettyfaces/rewrite-config-prettyfaces.xsd">
</pretty-config>发布于 2013-06-17 16:27:56
编辑:碰巧,这是一个在2.0.4版本中修复的重写中的错误。(见相关论坛后http://ocpsoft.org/support/topic/prettyfaces-with-container-based-security/ )
https://stackoverflow.com/questions/17133638
复制相似问题