How to create a system user via curl? | Community
Skip to main content
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 smacdonald2008

To create a system user in AEM involves doing it manually - as discussed in this article: 

https://helpx.adobe.com/experience-manager/using/querying-experience-manager-sling.html

You cannot create a system user via the User Manager API either. 

Hope this helps. 

8 replies

smacdonald2008
smacdonald2008Accepted solution
Level 10
January 26, 2017

To create a system user in AEM involves doing it manually - as discussed in this article: 

https://helpx.adobe.com/experience-manager/using/querying-experience-manager-sling.html

You cannot create a system user via the User Manager API either. 

Hope this helps. 

kautuk_sahni
Community Manager
Community Manager
January 27, 2017

Please have a l look at following CURL commands:-

// Link:- https://hashimkhan.in/2015/05/27/aem-with-curl/

  • Create a new User
     
 
curl -u admin:admin -FcreateUser= -FauthorizableId=hashim -Frep:password=hashim http://localhost:4502/libs/granite/security/post/authorizables
  • Create a new Group
     
 
curl -u admin:admin -FcreateGroup=group1 -FauthorizableId=testGroup1 http://localhost:4502/libs/granite/security/post/authorizables
  • Add a Property to an existing User
     
 
curl -u admin:admin -Fprofile/age=25 http://localhost:4502/home/users/h/hashim.rw.html
  • Create a User with a profile
     
1
curl -u admin:admin -FcreateUser=testuser -FauthorizableId=hashimkhan -Frep:password=hashimkhan -Fprofile/gender=male http://localhost:4502/libs/granite/security/post/authorizables
  • Create a new User as a member of a Group
     
 
curl -u admin:admin -FcreateUser=testuser -FauthorizableId=testuser -Frep:password=abc123 -Fmembership=contributor http://localhost:4502/libs/granite/security/post/authorizables
  • Add User to a Group
     
 
curl -u admin:admin -FaddMembers=testuser1 http://localhost:4502/home/groups/t/testGroup.rw.html
  • Remove a User from a Group
     
 
curl -u admin:admin -FremoveMembers=testuser1 http://localhost:4502/home/groups/t/testGroup.rw.html
  • Set a User’s Group Memberships
     
 
curl -u admin:admin -Fmembership=contributor -Fmembership=testgroup http://localhost:4502/home/users/t/testuser.rw.html
  • Delete user and Group
     
 
curl -u admin:admin -FdeleteAuthorizable= http://localhost:4502/home/users/t/testuser
curl -u admin:admin -FdeleteAuthorizable= http://localhost:4502/home/groups/t/testGroup
  • Change a user password
     
 
curl -u testuser:OLD_PWD -F rep:password=”NEW_PWD” http://localhost:4502/home/users/t/testuser.rw.html
curl rep:password=”test” –user admin:admin http://localhost:4502/home/users/a/alister@geometrixx.com4502/home/users/a/alister@geometrixx.com
 

 

Adding more reference links:

Link:- https://gist.github.com/joemaffia/dd55e4c43a24c4948e8d

Link:- http://www.aemcq5tutorials.com/tutorials/adobe-cq5-aem-curl-commands/

I hope this would help you.

~kautuk

Kautuk Sahni
smacdonald2008
Level 10
January 27, 2017

As Kautuk pointed out - you can create an AEM user via CURL - however - not a system user. 

January 30, 2017

This worked for me.

curl -u <admin_username>:<admin_password> http://localhost:<aem_port>/crx/explorer/ui/usereditor_list.jsp -H 'Content-Type: multipart/form-data' -H 'Referer: http://localhost:<aem_port>/crx/explorer/ui/usereditor_list.jsp' -F Path=/home/users -F action_ops=create -F FormEncoding=UTF-8 -F uid=<service_user_name> -F createModus=8

ronnyfm
ronnyfmAuthor
Level 4
March 6, 2017
        Thanks. Yes, that is unfortunately since it cannot be automated. Any hint if it is something being considered or is there a security / design concern for that?
March 6, 2017
This can be automated through adding it to the build. ACS Commons does this https://github.com/Adobe-Consulting-Services/acs-aem-commons/pull/857
Level 2
March 8, 2017
        Interesting, I will try that. Thank you!
ronnyfm
ronnyfmAuthor
Level 4
April 20, 2017
        And it works! Thank you!