我正在尝试将一个应用程序从WebSphere 7.0迁移到JBoss EAP6.4。
我已经做了所有需要的更改来查看网页。但我的问题从这一点开始。
在web.xml上,几个jsp文件有6个不同的安全角色声明。
当我从浏览器打开应用程序时,它会显示欢迎页面,
但是当我点击登录按钮时,我在EAP 6.4的屏幕上看到403错误。
当我在WebSphere上打开相同的应用程序并单击登录按钮时,它会打开一个浏览器弹出窗口,要求输入用户名和密码。
Security roels是这样的
<security-role>
<description></description>
<role-name>xxxx</role-name>
</security-role>
<security-role>
<description></description>
<role-name>yyyy</role-name>
</security-role>
<security-role>
<description></description>
<role-name>zzzz</role-name>
</security-role>
<security-role>
<description></description>
<role-name>kkkk</role-name>
</security-role>
<security-role>
<description></description>
<role-name>pppp</role-name>
</security-role>
<security-role>
<description></description>
<role-name>llll</role-name>
</security-role>并将其作为jsp页面的身份验证约束和安全约束给出。
<security-constraint>
<display-name>xxxx</display-name>
<web-resource-collection>
<web-resource-name>xxxx</web-resource-name>
<description></description>
<url-pattern>/jsp/auth/*</url-pattern>
<url-pattern>/jsp/includes/*</url-pattern>
<url-pattern>*.do</url-pattern>
<url-pattern>/jsp/menu.jsp</url-pattern>
<http-method>GET</http-method>
<http-method>PUT</http-method>
<http-method>HEAD</http-method>
<http-method>TRACE</http-method>
<http-method>POST</http-method>
<http-method>DELETE</http-method>
<http-method>OPTIONS</http-method>
</web-resource-collection>
<auth-constraint>
<description></description>
<role-name>xxxx</role-name>
</auth-constraint>
</security-constraint>我认为我必须在JBoss EAP6.4上定义这些角色,才能像在WebSphere上一样工作。
因此,我的问题是:如何在JBoss EAP6.4中定义这些角色?我检查了文档,并试图这样做,但无法使其工作。
谢谢。
发布于 2019-08-02 21:41:34
我解决了我自己的问题。
解决步骤如下:
1-打开jboss-cli.bat并在服务器启动时连接->
2-运行此命令: /core-service=management/access=authorization:write-attribute(name=provider,value=rbac)
3-打开add-user.bat
4-将新用户添加到具有所需组的ApplicationRealm。这些都是我作为角色提出的问题。
应用程序检查应用程序-users.properties和AFter -Roles.properties。如果你写给add-user.bat的那些文件都在那里,那么你就可以开始了。
如果提供者更改为基于角色的访问控制,还要检查standalone.xml。
这就是我为让它工作所做的一切。
https://stackoverflow.com/questions/57310153
复制相似问题