Using a JCR Repository instance, I did it this way

----------------------------

session = repository.login(new SimpleCredentials(_adminUserId,
_adminPassword.toCharArray()));

UserManager userManager = ((SessionImpl) session).getUserManager();

// Create User
String username = "test-user";
User _user = userManager.createUser(username, "test-password");
_user.setProperty("foo", session.getValueFactory().createValue("bar"));
session.save();

----------------------------

I'd love to know if there are other/better ways to manage users? Or how to
do it with an Oak Repository instance.

hope this helps,
--mike



On Tue, Jan 20, 2015 at 11:15 PM, Raymond Boswel <[email protected]>
wrote:

> Hi Team,
>
> I feel like this should be really obvious, but I can't find this documented
> anywhere. At the moment I've figured out how to do most of what I want to
> accomplish with Oak, but I do everything logged in as the default admin
> user. What is the correct way to define a new user for the oak repo?
>
> Thanks for all the good work :)
>
> Kind regards,
> Raymond Boswel
>

Reply via email to