Using curl for creating user vs Manual creation | Community
Skip to main content
Level 2
Jul 10, 2019 4:17 AM UTC

Using curl for creating user vs Manual creation

Hi All,

I'm trying to automate creating users in AEM and using curl command to create users. Below is the command which I'm using for creating user "test1"

curl -u admin:admin -FcreateUser= -FauthorizableId=test1 -Frep:password=test1 -Fprofile/givenName=test1 -Fprofile/familyName=test1 -Fprofile/email=test1@metlife.com -FintermediatePath=/home/users/company http://localhost:4502/libs/granite/security/post/authorizables

I'm able to create user but I'm seeing extra node "profiles" for this "test1" user in crx/de. I have compared this node structure with another user (test2) created manually from useradmin page and "test2" user doesn't have this node.

Could you let me know why there is a difference in node structure using curl command? Is this will cause any issue for users if we use curl to create users?

Thanks.

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

7 replies

Employee
Jul 26, 2019 1:19 AM UTC

Can you share details about what AEM version you are on ?

I tested creating a user via Tools>Security>User and cURL and both results in the profile and profiles node creation

Tested on 6.5 GA and 6.6 L7 (Adobe internal testing version)

Translate
Akash_Kapoor
Employee
Jul 11, 2019 4:40 AM UTC

Hi,

AFAIU, The extra node seems to be getting created as you are forcing the profile node in your curl command itself that should not be done in the request. You just need to pass the values of properties like givenname, lastname, email etc in the command and internally a profile node is created to store them but since you are forcing the path as well. One of them is getting created due to your command and the other is due the internal implementation.

Translate
Antony679Author
Level 2
Jul 11, 2019 5:10 PM UTC

Could you please provide curl syntax  for setting up givenname,lastname,email etc instead of using -Fprofile ?

Translate
Nisha_Nivedita
Employee
Jul 10, 2019 5:40 AM UTC

antonym8430968 You can create user with following curl commands:

Create New User:

curl -u admin:admin -FcreateUser= -FauthorizableId=test -Frep:password=test http://localhost:4502/libs/granite/security/post/authorizables

Create new user and assign to specific group:

curl -u admin:admin -FcreateUser=testusr -FauthorizableId=testusr -Frep:password=test1234 -Fmembership=testgroup http://localhost:4502/libs/granite/security/post/authorizables

Translate
Antony679Author
Level 2
Jul 10, 2019 5:03 PM UTC

Using above curl commands will not update user profile details like Firstname,lastname, email and Path.

The command which I'm using is working. My question is more on why "profiles/public" extra node(refer screenshot) is getting created when we create user using curl command.

By the way, I'm doing this in AEM 6.5

Thanks.

Translate
Antony679Author
Level 2
Jul 10, 2019 8:15 PM UTC

Any information on my post will be helpful?

Thanks.

Translate
Prince_Shivhare
New Participant
Jul 10, 2019 5:14 AM UTC

Can you try this command in your local

curl -u admin:admin -FcreateUser= -FauthorizableId=hashim -Frep:password=hashim http://localhost:4502/libs/granite/security/post/authorizables

Translate