gpt4 book ai didi

security - "JACC Policy Provider:Failed Permission Check"在没有授权约束的安全受限登录页面上

转载 作者:行者123 更新时间:2023-12-04 20:46:42 25 4
gpt4 key购买 nike

当从 Internet 向登录页面发出请求时,我从 netbeans glassfish 输出窗口得到了这个结果:

INFO: JACC Policy Provider:Failed Permission Check: context (" WebApplication2/WebApplication2 ") , permission (" ("javax.security.jacc.WebUserDataPermission" "/login.xhtml" "GET") ")



当从 LAN 或本地主机发出请求并且根据需要通过 HTTPS 提供页面时,不会发生这种情况。

我正在尝试将登录页面配置为在登录请求期间使用传输层安全保护用户密码。我希望这可以仅使用在 web.xml 部署描述符中具有声明性安全性的 Faces Servlet 来实现。

我使用基于表单的身份验证和非 j_security_check 自定义 Facelet 表单通过 request.login 方法进行编程登录。登录表单在 web.xml 中具有以下安全约束:

 <security-constraint>
<display-name>secure login</display-name>
<web-resource-collection>
<web-resource-name>login.xhtml</web-resource-name>
<description/>
<url-pattern>/login.xhtml</url-pattern>
</web-resource-collection>
<user-data-constraint>
<description/>
<transport-guarantee>CONFIDENTIAL</transport-guarantee>
</user-data-constraint>
</security-constraint>

没有授权约束元素,因为此表单显然适用于未经身份验证的用户。存在安全约束的唯一原因是可以将子元素设置为 CONFIDENTIAL 以确保安全连接。

Java EE 6 教程说明 here那:

If there is no authorization constraint, the container must accept the request without requiring user authentication





The user data constraint is handy to use in conjunction with basic and form-based user authentication. When the login authentication method is set to BASIC or FORM, passwords are not protected, meaning that passwords sent between a client and a server on an unprotected session can be viewed and intercepted by third parties. Using a user data constraint with the user authentication mechanism can alleviate this concern. Configuring a user authentication mechanism is described in Specifying an Authentication Mechanism in the Deployment Descriptor.



为什么 JACC 在访问此资源不需要此类检查时要进行权限检查?为什么它只从 Internet 失败而不是在 LAN 上失败?

最佳答案

只需清理项目并重新启动服务器!这对我来说很好用!!有时会在缓存中咳出某些文件!!这些文件可能会导致这个错误!!因此,在清理项目时,错误将得到修复!!

关于security - "JACC Policy Provider:Failed Permission Check"在没有授权约束的安全受限登录页面上,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/16745027/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com