Expand my Community achievements bar.

SOLVED

Programmatically create Users using Jackrabbit Usermanager api

Avatar

Level 10

Hello,

Is there a way i could have a java code to create user using jackrabbit usermanager api. I tried using 

  JackrabbitSession jsession = (JackrabbitSession) session;

and i get the below error, 
java.lang.ClassCastException: org.apache.jackrabbit.jcr2spi.SessionImpl cannot be cast to org.apache.jackrabbit.api.JackrabbitSession

Anyone with help?

Regards,

NZ

1 Accepted Solution

Avatar

Correct answer by
Employee

So as I said, you'll need to run the code which actually interacts with the UserManager local to the AEM instance on which you want to create/modify users and groups. If you need to expose that remotely, you will need to either create your own service interface or use the Granite HTTP interface. http://www.wemblog.com/2012/03/how-to-do-user-management-using-post.html has some documentation on this HTTP interface.

View solution in original post

5 Replies

Avatar

Level 10

Hello Justin, 

Thanks for responding,To elaborate, I would like to create users programmatically from a java code or have a soap based invocation to create users in AEM instance set up locally,I basically have the users profile created on one server i would like to have them created and stored in AEM, so that way i have AEM with same users as in the other server. Is there any other approach apart from jackrabbit usermanager over DavEx if this is not the best way to go about?

Regards,

NZ

Avatar

Correct answer by
Employee

So as I said, you'll need to run the code which actually interacts with the UserManager local to the AEM instance on which you want to create/modify users and groups. If you need to expose that remotely, you will need to either create your own service interface or use the Granite HTTP interface. http://www.wemblog.com/2012/03/how-to-do-user-management-using-post.html has some documentation on this HTTP interface.

Avatar

Employee

Hi,

I believe you are trying to use the UserManager over DavEX. This is not supported. You can only use the UserManager locally. See http://markmail.org/message/zvtiihhyjkqlyizg

Justin