簡體   English   中英

使用IBM VMM在自定義聯邦存儲庫中創建用戶

[英]Create user in Custom Federal Repository using IBM VMM

我正在嘗試使用IBM Virtual Member Manager API(Java代碼)在自定義LDAP存儲庫(例如:RepositoryID = custpmRepo)中創建一個新用戶。 嘗試使用IBM代碼創建用戶。 但這是在默認存儲庫(defaultWIMFileBasedRealm- InternalFileRepository)中創建用戶。

IBM文檔引用了https://www.ibm.com/support/knowledgecenter/SSAW57_8.0.0/com.ibm.websphere.wim.doc/programmingprereq.html https://www.ibm.com/support/knowledgecenter/SSAW57_8。 0.0 / com.ibm.websphere.wim.doc / samplecodeforworkingwithusersandgroups.html

誰能指導我如何使用VMM API(Java代碼)在自定義LDAP存儲庫中創建用戶。 下面是我用來創建用戶的代碼

public static void addPersonAccount(String uid, String cn, String sn)
{
    System.out.println("****#### UserAndGroupSample - addPersonAccount - Entering Method");
    try
    {
        locateService(EJB_JNDI_NAME);
        DataObject root = SDOHelper.createRootDataObject();
        DataObject entity = SDOHelper.createEntityDataObject(root, null, 
                SchemaConstants.DO_PERSON_ACCOUNT);
        entity.set("uid", uid);
        entity.set("cn", cn);
        System.out.println("Input data graph before creating user"+ printDO(root));
        // Create the PersonAccount entity
        root = service.create(root);
        System.out.println("Output data graph after creating user"+ printDO(root));
    }
    catch(Exception e)
    {
        System.out.println("Exception: " + e.getMessage());
        e.printStackTrace();
    }

    System.out.println("****#### UserAndGroupSample - addPersonAccount - Exiting Method");
}

可以通過設置父用戶來設置以下屬性,以在所需的自定義LDAP存儲庫(默認父文件或在其他OrgContainer下)中創建用戶。createDataObject(DO_PARENT).createDataObject(DO_IDENTIFIER).setString(PROP_UNIQUE_NAME,parentDN),其中parentDN是父級的唯一名稱,例如o = LDAP或ou = sample,o = defaultWIMFileBasedRealm

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM