如何定义JBOSS安全角色 - 从WebSphere迁移到EAP 6.4



我试图将申请的申请从WebSphere 7.0迁移到JBOSS EAP 6.4。

我已经完成了所有需要的更改以查看网页。但是我的问题始于那时。

在web.xml上有6个不同的JSP文件的6种不同的安全性声明。

当我从浏览器打开应用程序时,它向我显示了欢迎页面,

但是当我单击登录按钮时,我在EAP 6.4上看到403错误。

当我在WebSphere上打开相同的应用程序并单击"登录"按钮时,它将打开浏览器弹出窗口,要求提供用户名和密码。

安全搬运是这些

<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页面的auth-constraint和安全规定。

<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 EAP 6.4上定义这些角色,以使其像在WebSphere上一样工作。

所以,我的问题是:如何在JBOSS EAP 6.4中定义这些角色?我检查了文档并尝试执行这些文档,但无法使其正常工作。

谢谢。

我解决了自己的问题。

解决方案步骤如下:

1-打开jboss-cli.bat和连接 ->服务器启动

2-运行此命令:/core-service =管理/access =授权:write-attribute(name =提供者,value = rbac(

3-打开add-user.bat

4-与您需要的组一起将新用户添加到ApplicationRealm中。我在质疑的角色上。

执行此操作后,请检查应用程序 - 用户。如果您写给add-user.bat的那些在那里,那么您就可以去了。

还要检查andalone.xml如果提供商更改为RBAC。

这就是我为使它起作用所做的一切。

最新更新