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

WebSphere Liberty How to Set up Authenticated Users in server.xml?

如何在 WebSphere Liberty 中设置经过身份验证的用户?我已按照此处列出的说明进行操作:https://www.ibm.com/support/knowledgecenter/SS7K4U_liberty/com.ibm.websphere.wlp.zseries.doc/ae/twlp_sec_rolebased.html and here: 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

这是帮助我解决问题的页面: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>