【问题标题】:How to define JBoss Security Roles - migration from WebSphere to EAP 6.4如何定义 JBoss 安全角色 - 从 WebSphere 迁移到 EAP 6.4
【发布时间】:2019-08-01 13:29:14
【问题描述】:

我正在尝试将应用程序从 WebSphere 7.0 迁移到 JBoss EAP 6.4。

我已完成所有必要的更改以查看网页。但我的问题从那时开始。

在 web.xml 中,多个 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 给出的。

<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 中定义这些角色?我检查了文档并尝试执行它们,但无法使其工作。

谢谢。

【问题讨论】:

    标签: jboss security-roles


    【解决方案1】:

    我解决了自己的问题。

    解决步骤如下:

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

    2- 运行此命令:/core-service=management/access=authorization:write-attribute(name=provider,value=rbac)

    3- 打开 add-user.bat

    4- 使用您需要的组将新用户添加到 ApplicationRealm。哪些是我作为角色提出的问题。

    之后检查 application-users.properties 和 application-roles.properties。如果你写到 add-user.bat 的文件在那里,那么你就可以开始了。

    如果提供程序更改为 RBAC,还要检查standalone.xml。

    这就是我所做的一切。

    【讨论】:

      猜你喜欢
      • 2018-09-16
      • 2021-08-26
      • 2018-03-27
      • 2016-09-10
      • 2023-03-08
      • 1970-01-01
      • 2018-01-31
      • 2021-02-22
      • 2021-01-26
      相关资源
      最近更新 更多