如何在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
这是我添加到server.xml中的内容:
<enterpriseApplication location="MyApplication.ear">
<application-bnd>
<security-role name="ROLE_AUTHENTICATED_USER">
<group name="admin" />
</security-role>
</application-bnd>
</enterpriseApplication>