websphere - Liberty 服务器 19.0.0.9 - 如何授权未经身份验证的用户
问题描述
我对容器安全有新问题。在服务器上,我有两只耳朵首先从第二个呼叫服务。在服务中有@RolesAllowed("Authenticated")。我在 server.xml 中的配置如下所示:
<featureManager>
<feature>jndi-1.0</feature>
<feature>distributedMap-1.0</feature>
<feature>localConnector-1.0</feature>
<feature>wasJmsClient-2.0</feature>
<feature>jdbc-4.1</feature-->
<feature>javaMail-1.5</feature>
<feature>json-1.0</feature>
<feature>adminCenter-1.0</feature>
<feature>appSecurity-2.0</feature>
<feature>beanValidation-2.0</feature>
<feature>cdi-2.0</feature>
<feature>jsf-2.3</feature>
<feature>mdb-3.2</feature>
<feature>ejbHome-3.2</feature>
<feature>ejbLite-3.2</feature>
<feature>ejbRemote-3.2</feature>
<feature>jca-1.7</feature>
<feature>concurrent-1.0</feature>
<feature>jms-2.0</feature>
<feature>appClientSupport-1.0</feature>
<feature>ldapRegistry-3.0</feature>
</featureManager>
<basicRegistry id="basic" realm="customRealm">
<user password="{xor}Ozo5Kiw6LQ==" name="defuser" />
</basicRegistry>
两只耳朵包含相同的配置
<application-bnd>
<security-role name="All Role">
<special-subject type="ALL_AUTHENTICATED_USERS" />
</security-role>
</application-bnd>
第二只耳朵包含 ibm-application-ibd.xml 文件,但我无法编辑它。最好是覆盖它。当我从第二只耳朵调用服务时,我仍然得到异常: 引起:javax.ejb.EJBAccessException:CWWKS9400A:用户在调用时授权失败 UNAUTHENTICATED
有什么想法吗?
解决方案
Liberty 允许您使用服务器配置元素application-bnd覆盖应用程序绑定文件,请参阅 IBM KnowledgeCenter 主题https://www.ibm.com/support/knowledgecenter/en/SSEQTP_liberty/com.ibm.websphere.liberty.autogen.base .doc/ae/rwlp_config_enterpriseApplication.html#application-bnd和https://www.ibm.com/support/knowledgecenter/en/SSEQTP_liberty/com.ibm.websphere.wlp.doc/ae/twlp_sec_rolebased.html了解详细信息。
推荐阅读
- regex - 仅当匹配时如何在正则表达式中使用子组
- cockroachdb - 使用密码连接 CockroachDB 失败包括“#”
- android - 将 SDK 从 29 降级到 SDK 28 后应用程序无法运行
- python - 匹配 CSV 文件中的文件名,然后将这些文件移动到新目录
- c# - 具有多对多和 IncludeMembers 的 Automapper
- mysql - 如何计算加入表mysql
- php - 无法在 laravel 控制器中返回视图
- c++ - 假设在没有锁的线程中更改全局布尔变量是安全的吗?
- javascript - 我正在尝试编写一个名为oddsUpTo 的程序,该程序返回一个数组,其中每个奇数最多为给定数字
- reactjs - 当 useCallback 似乎没有帮助时,如何解决“React Hook useEffect 缺少依赖项...”。我需要将我的 API_KEY 添加为依赖项