Expand my Community achievements bar.

SOLVED

How to create a system user via curl?

Avatar

Level 4

Is that even possible? At least from AEM 6.1 and onward

1 Accepted Solution

Avatar

Correct answer by
Level 10

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. 

View solution in original post

8 Replies

Avatar

Correct answer by
Level 10

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. 

Avatar

Administrator

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

Avatar

Level 10

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

Avatar

Level 1

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

Avatar

Level 4
        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?

Avatar

Level 2
        Interesting, I will try that. Thank you!

Avatar

Level 4
        And it works! Thank you!