WebSphere Liberty如何在server.xml中设置经过身份验证的用户?

问题描述 投票:1回答:1

如何在WebSphere Liberty中设置经过身份验证的用户?我已按照此处列出的说明进行操作:https://www.ibm.com/support/knowledgecenter/SS7K4U_liberty/com.ibm.websphere.wlp.zseries.doc/ae/twlp_sec_rolebased.html和此处:https://www.ibm.com/support/knowledgecenter/SSEQTP_liberty/com.ibm.websphere.wlp.doc/ae/twlp_sec_basic_registry.html

但是我仍然缺少一些难题。

这是我的ibm-application-bnd.xml的样子:

    <application-bnd>
        <security-role name="AllAuthenticated">
            <special-subject type="ALL_AUTHENTICATED_USERS" />
        </security-role>
    </application-bnd>

这是server.xml:

<basicRegistry id="basic" realm="WebRealm">
    <user name="wasadmin" password="wasadmin" />
    <user name="user1" password="test" />
    <user name="user2" password="test" />
    <group name="admin">
      <member name="wasadmin" />
   </group>

   <group name="users">
      <member name="wasadmin" />
      <member name="user1" />
      <member name="user2" />
   </group>
</basicRegistry>    

<administrator-role>
    <user>wasadmin</user>
</administrator-role>

这里是错误消息

CWWKS9104A: Authorization failed for user wasadmin:defaultRealm while invoking MyApplication on /myapplication-mainPage. The user is not granted access to any of the required roles: [ROLE_AUTHENTICATED_USER].

我需要定义一个AllAuthenticated角色吗?它的名字是AllAuthenticated-role吗?如何使它不查找DefaultRealm

authentication websphere websphere-liberty
1个回答
2
投票
这是帮助我找出问题的页面:https://www.ibm.com/support/knowledgecenter/SSEQTP_liberty/com.ibm.websphere.wlp.doc/ae/twlp_sec_quickstart.html

这是我添加到server.xml中的内容:

<enterpriseApplication location="MyApplication.ear"> <application-bnd> <security-role name="ROLE_AUTHENTICATED_USER"> <group name="admin" /> </security-role> </application-bnd> </enterpriseApplication>

© www.soinside.com 2019 - 2024. All rights reserved.