use of org.forgerock.openam.utils.CollectionUtils.asSet in project OpenAM by OpenRock.
the class AMSetupServlet method createDemoUser.
private static void createDemoUser() throws IdRepoException, SSOException {
SetupProgress.reportStart("configurator.progress.create.demo.user", null);
Map<String, Set<String>> attributes = new HashMap<String, Set<String>>();
attributes.put("sn", CollectionUtils.asSet("demo"));
attributes.put("cn", CollectionUtils.asSet("demo"));
attributes.put("userpassword", CollectionUtils.asSet("changeit"));
attributes.put("inetuserstatus", CollectionUtils.asSet("Active"));
try {
AMIdentityRepository amir = new AMIdentityRepository(getAdminSSOToken(), "/");
amir.createIdentity(IdType.USER, "demo", attributes);
} catch (IdRepoException e) {
Debug.getInstance(SetupConstants.DEBUG_NAME).error("AMSetupServlet.createDemoUser", e);
throw e;
} catch (SSOException e) {
Debug.getInstance(SetupConstants.DEBUG_NAME).error("AMSetupServlet.createDemoUser", e);
throw e;
}
SetupProgress.reportEnd("emb.done", null);
}
Aggregations