It's all about the answers!

Ask a question

Creating user in TomCat using IExternalUserRegistryManager


K M (38324649) | asked Jun 28 '10, 8:39 a.m.
Does anyboy have an example how to use this api calss to create users in Tomcat.

One answer



permanent link
Dong Young Kim (1931820) | answered Feb 28 '12, 12:12 a.m.
JAZZ DEVELOPER
I used the following code snippet.

IContributorManager contributorManager = repo.contributorManager();
String groups[] = {"JazzUsers"};
String user_id = "test";

// create a user into "Tomcat" External User Registry
String user_name = "TEST";
String password = user_id;
String email = user_id+"@my.com";
userRegistryManager.addExternalUser(user_id, password, user_name, email, groups, monitor);
System.out.println("Add user to Tomcat.");

// create a user into Jazz DB
IContributor contributor = (IContributor) IContributor.ITEM_TYPE.createItem();
contributor.setUserId(user_id);
contributor.setName(user_name);
contributor.setEmailAddress(email);
contributorManager.saveContributor(contributor, monitor);
System.out.println("Add user to Jazz.");

Your answer


Register or to post your answer.