Programmatically create Users using Jackrabbit Usermanager api | Community
Skip to main content
Level 9
October 16, 2015
Solved

Programmatically create Users using Jackrabbit Usermanager api

  • October 16, 2015
  • 5 replies
  • 1831 views

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

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
Best answer by JustinEd3

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.

5 replies

Level 9
October 16, 2015

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

Level 9
October 16, 2015

Thanks Justin. It helped.

JustinEd3Adobe EmployeeAccepted solution
Adobe Employee
October 16, 2015

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.

smacdonald2008
Level 10
October 16, 2015

To learn how to write an OSGi bundle that uses the Jackrabbit UserManager APIs, see http://helpx.adobe.com/experience-manager/using/developing-aem-osgi-bundles-jackrabbit.html

Adobe Employee
October 16, 2015

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