VMM 如何查找或获取 VMM 实体属性映射/属性名称

VMM how to find or fetch VMM entity attribute mapping / attribute names

起点: 我有一个具有联合安全性的 WebSphere(它背后有一个 Active Directory)。 我正在尝试通过 his/her 电子邮件地址获取 VMM 用户 uid,但我不知道它的 VMM(架构)属性如何映射到基础 Active Directory 实体(人员,人员, organizationalPerson 对象类,邮件属性。

(换种方式描述:如果查看 WAS 控制台,在“用户和组”->“管理用户”中有一个 table,其中有一个 E -邮件列,所以它以某种方式被映射。 但是,通过单击(“全局安全”->“(联合存储库)配置按钮”->(有一个 table,您可以 select))LDAP1 行,并检查 table 在“联合存储库 属性 名称到 LDAP 属性映射”中,我没有发现 'E-Mail' 列如何映射到 AD 属性。也许有一个隐式映射?)

所以,开始的问题是:

如何在WAS控制台上找到这个?或者,也许通过 wsadmin(脚本)?

因此,正因为如此,我试图继续前进,现在我会尝试使用 VMM API 找到它,但我在官方文档中找不到第二个问题的答案:

是否有可能以某种方式获取 WebSphere VMM 实体(虚拟成员管理器)的分配/可用属性?

有很多关于how to fetch the attributes when you know their name的例子,但是没有关于这个的...

是的,我知道这是一个有点 XY 的问题,但请指导我一下。 非常感谢。

为了提供一些代码示例,我尝试使用以下代码获取用户的 uid:

    public String testFetch(String email) throws Exception
    {
     
        String returnAttr = "uid";
        // here in the search expression what should I wrire instead of the 'mail'?
        String vmmSearchExpr = String.format("@xsi:type='PersonAccount' and mail='%s'", email);
        DataObject root = SDOHelper.createRootDataObject();
        DataObject searchCtrl = SDOHelper.createControlDataObject(root, null, SchemaConstants.DO_SEARCH_CONTROL);
        searchCtrl.setString(SchemaConstants.PROP_SEARCH_EXPRESSION, vmmSearchExpr);
        @SuppressWarnings("unchecked")
        List<String> props = searchCtrl.getList(SchemaConstants.PROP_PROPERTIES);
        props.add(returnAttr);
        Service service = new LocalServiceProvider(null);
        DataObject searchRoot = service.search(root);
        String result = "";
        List<?> entities = searchRoot.getList(SchemaConstants.DO_ENTITIES);
        if (entities.size() > 1) throw new RuntimeException("multiple users for an identity:" + vmmSearchExpr);
        if (entities.size() > 0)
        {
            DataObject objdo = (DataObject) entities.get(0);
            result = objdo.getString(returnAttr);
        }else{
            log("Got empty list There is no result.");
        }
        return result;
    }

一种可能的解决方案是添加支持的新联邦存储库属性(名称:mail,属性名称:mail,实体类型:PersonAccount):

重新启动 WAS 后,我可以使用搜索表达式

@xsi:type='PersonAccount' and mail='<email address>'

和上面的代码将相应的 uid 提取到给定的电子邮件地址。 似乎在 c:\IBM\WebSphere\AppServer\etc\wim\setup\wimdbproperties.xml 中有一些信息,好像“ibm-primaryEmail”将是包含电子邮件地址的 属性,尽管我无法做到当我指定这个而不是“邮件”属性名称时找到我的 uid。