【发布时间】:2017-11-02 16:15:53
【问题描述】:
我正在尝试使用 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");
}
【问题讨论】:
标签: java websphere single-sign-on websphere-8 virtual-member-manager