Java 为什么我会得到;错误403:AuthorizationFailed";在这个简单的WebSphere示例web.xml中?
我正在使用WebSphere7。我有一个使用web.xml设置的简单示例,如下所示 我就是这样测试它的:Java 为什么我会得到;错误403:AuthorizationFailed";在这个简单的WebSphere示例web.xml中?,java,authentication,websphere,web.xml,Java,Authentication,Websphere,Web.xml,我正在使用WebSphere7。我有一个使用web.xml设置的简单示例,如下所示 我就是这样测试它的: 我从WebSphere中没有用户和组开始 我尝试访问系统提示我登录的页面(/restricted/topsecret.html)。我不能 我使用WebSphere管理控制台添加了一个用户/密码“rob/password”。我现在可以登录了,但是我看不到该页面。我得到一个“403:AuthorizationFailed”错误 我添加了一个名为“ROLE1”的组,并使用WebSphere管理控制
页面测试1
/受限/topsecret.html
得到
邮递
角色1
没有一个
usertest.jsp
<%@ page session="true" %>
Logged in username = '<%= request.getRemoteUser() %>' // is always null
<p/>
Logged in username = '<%= request.getUserPrincipal() %>' // is always null
登录用户名=“”//始终为空
登录用户名=“”//始终为空
有三个安全级别
JSP中的代码(第一行在语法上看起来不太好。我假设输入错误)这是针对WAS7的。我最近遇到了应用程序抛出403错误的问题。
ibm-application-bnd.xml
<security-role name="DefaultRole">
<special-subject type="ALL_AUTHENTICATED_USERS" /></security-role>
<security-role name="NoSecurity">
<special-subject type="EVERYONE" /></security-role></application-bnd>
ibm-application-bnd.xml
application.xml
<security-role>
<role-name>DefaultRole</role-name>
</security-role>
<security-role>
<role-name>NoSecurity</role-name>
</security-role>
默认角色
鼻安全
检查xml文件管理和应用程序级别都处于启用状态。Java2级别已关闭。是这样吗?不,usertest.jsp不安全;我尝试在登录到安全页面后访问它。是的,我在添加角色后重新启动了应用程序。是的,输入错误,已更正,谢谢。仅供参考,我发现了另一个(相关)问题。我发布了一个新的问题,重点是它,这里的链接-请帮助,如果你可以,谢谢--
<security-role>
<role-name>DefaultRole</role-name>
</security-role>
<security-role>
<role-name>NoSecurity</role-name>
</security-role>