Your achievements

Level 1

0% to

Level 2

Tip /
Sign in

Sign in to Community

to gain points, level up, and earn exciting badges like the new
BedrockMission!

Learn More

View all

Sign in to view all badges

Using curl for creating user vs Manual creation

Avatar

Avatar
Validate 1
Level 2
antonym8430968
Level 2

Like

1 like

Total Posts

25 posts

Correct Reply

2 solutions
Top badges earned
Validate 1
Boost 1
Affirm 1
View profile

Avatar
Validate 1
Level 2
antonym8430968
Level 2

Like

1 like

Total Posts

25 posts

Correct Reply

2 solutions
Top badges earned
Validate 1
Boost 1
Affirm 1
View profile
antonym8430968
Level 2

09-07-2019

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?

users_nodes.JPG

Thanks.

Replies

Avatar

Avatar
Springboard
Level 7
Prince_Shivhare
Level 7

Likes

113 likes

Total Posts

395 posts

Correct Reply

64 solutions
Top badges earned
Springboard
Establish
Give Back 100
Boost 100
Validate 1
View profile

Avatar
Springboard
Level 7
Prince_Shivhare
Level 7

Likes

113 likes

Total Posts

395 posts

Correct Reply

64 solutions
Top badges earned
Springboard
Establish
Give Back 100
Boost 100
Validate 1
View profile
Prince_Shivhare
Level 7

09-07-2019

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

Avatar

Avatar
Boost 5
Employee
Nisha_Nivedita
Employee

Likes

15 likes

Total Posts

26 posts

Correct Reply

8 solutions
Top badges earned
Boost 5
Boost 3
Boost 10
Boost 1
Applaud 5
View profile

Avatar
Boost 5
Employee
Nisha_Nivedita
Employee

Likes

15 likes

Total Posts

26 posts

Correct Reply

8 solutions
Top badges earned
Boost 5
Boost 3
Boost 10
Boost 1
Applaud 5
View profile
Nisha_Nivedita
Employee

09-07-2019

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

Avatar

Avatar
Validate 1
Level 2
antonym8430968
Level 2

Like

1 like

Total Posts

25 posts

Correct Reply

2 solutions
Top badges earned
Validate 1
Boost 1
Affirm 1
View profile

Avatar
Validate 1
Level 2
antonym8430968
Level 2

Like

1 like

Total Posts

25 posts

Correct Reply

2 solutions
Top badges earned
Validate 1
Boost 1
Affirm 1
View profile
antonym8430968
Level 2

10-07-2019

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.

Avatar

Avatar
Validate 1
Level 2
antonym8430968
Level 2

Like

1 like

Total Posts

25 posts

Correct Reply

2 solutions
Top badges earned
Validate 1
Boost 1
Affirm 1
View profile

Avatar
Validate 1
Level 2
antonym8430968
Level 2

Like

1 like

Total Posts

25 posts

Correct Reply

2 solutions
Top badges earned
Validate 1
Boost 1
Affirm 1
View profile
antonym8430968
Level 2

10-07-2019

Any information on my post will be helpful?

Thanks.

Avatar

Avatar
Give Back 5
Employee
akashk22786878
Employee

Likes

30 likes

Total Posts

25 posts

Correct Reply

4 solutions
Top badges earned
Give Back 5
Give Back 3
Give Back
Boost 5
Boost 3
View profile

Avatar
Give Back 5
Employee
akashk22786878
Employee

Likes

30 likes

Total Posts

25 posts

Correct Reply

4 solutions
Top badges earned
Give Back 5
Give Back 3
Give Back
Boost 5
Boost 3
View profile
akashk22786878
Employee

10-07-2019

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.

Avatar

Avatar
Validate 1
Level 2
antonym8430968
Level 2

Like

1 like

Total Posts

25 posts

Correct Reply

2 solutions
Top badges earned
Validate 1
Boost 1
Affirm 1
View profile

Avatar
Validate 1
Level 2
antonym8430968
Level 2

Like

1 like

Total Posts

25 posts

Correct Reply

2 solutions
Top badges earned
Validate 1
Boost 1
Affirm 1
View profile
antonym8430968
Level 2

11-07-2019

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

Avatar

Avatar
Give Back 10
Employee
lmha
Employee

Likes

16 likes

Total Posts

20 posts

Correct Reply

4 solutions
Top badges earned
Give Back 10
Give Back 5
Give Back 3
Give Back
Boost 5
View profile

Avatar
Give Back 10
Employee
lmha
Employee

Likes

16 likes

Total Posts

20 posts

Correct Reply

4 solutions
Top badges earned
Give Back 10
Give Back 5
Give Back 3
Give Back
Boost 5
View profile
lmha
Employee

25-07-2019

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)