使用 war 时,IBM Liberty (WLP) 中的组到角色映射 [英] Group to role mapping in IBM Liberty (WLP) when using war
问题描述
不幸的是,在 Java EE 中,某些服务器需要特定于供应商的组到安全配置的角色映射.对于这些服务器,即使真的没有要映射的东西,这种映射也是强制性的.
In Java EE some servers unfortunately require a vendor specific group to role mapping for the security configuration. For these servers, such mapping is mandatory even when there really is nothing to map.
不幸的是,IBM Liberty 就是这样一个服务器.它需要一个名为 ibm-application-bnd.xml
的文件中的映射,该文件应该放在 EAR 的 META-INF/文件夹中.例如:
Unfortunately, IBM Liberty is such a server. It requires a mapping in a file called ibm-application-bnd.xml
, that one is supposed to put inside an EAR's META-INF/ folder. For example:
<?xml version="1.0" encoding="UTF-8"?>
<application-bnd xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://websphere.ibm.com/xml/ns/javaee http://websphere.ibm.com/xml/ns/javaee/ibm-application-bnd_1_2.xsd"
xmlns="http://websphere.ibm.com/xml/ns/javaee"
version="1.2">
<security-role name="architect">
<group name="architect" />
</security-role>
</application-bnd>
更不幸的是,这个文件似乎只能从 EAR 中使用.
Even more unfortunate is that seemingly this file can only be used from an EAR.
在将 WAR 与 Liberty 一起使用时,如何从应用程序存档中指定组到角色的映射?
How can group to role mapping be specified from within the application archive when using a WAR with Liberty?
(不幸的是,我无法使用需要我更改服务器内部任何内容或与任何类型的控制台或图形管理界面交互的解决方案)
推荐答案
这篇文章有点过时,但这里是我的发现,供其他可能在此问题上苦苦挣扎的人使用.
This post is a bit dated but here are my finding for anyone else who may be struggling with this issue.
使用最新版本的 WebSphere Liberty(当前为 @ 8.5.5.6),您可以将应用程序绑定文件 (ibm-application-bnd.xml) 放入 Web 应用程序的 META-INF 文件夹中,Liberty 将解析绑定文件,就像它被封装在一个 EAR 中.我不确定这是否是记录在案的功能.
With the latest version of WebSphere Liberty (currently @ 8.5.5.6) you can place your application bindings file (ibm-application-bnd.xml) into the web application's META-INF folder and Liberty will parse the bindings file as if it was packaged in an EAR. I am not sure if this is a documented feature or not.
这篇关于使用 war 时,IBM Liberty (WLP) 中的组到角色映射的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!