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

Problem using curl to create user profile

Avatar

Avatar
Validate 10
Level 2
Rui_J
Level 2

Likes

4 likes

Total Posts

39 posts

Correct Reply

1 solution
Top badges earned
Validate 10
Validate 1
Boost 3
Boost 1
Affirm 1
View profile

Avatar
Validate 10
Level 2
Rui_J
Level 2

Likes

4 likes

Total Posts

39 posts

Correct Reply

1 solution
Top badges earned
Validate 10
Validate 1
Boost 3
Boost 1
Affirm 1
View profile
Rui_J
Level 2

07-06-2017

Hi,

  I am trying to use Sling @TypeHint to set profile/age = 30, which age is a Long data type.

  So this is what I did in curl cmd

curl -u admin:admin -FcreateUser= -FauthorizableId=testuser -Frep:password=testuser -Fprofile/age@TypeHint=Long -Fprofile/age=30  -FintermediatePath="/home/users/test/" http://localhost:4501/libs/granite/security/post/authorizables

  

    But this is not working. Can someone tell me how to fix this?

Thank you

Accepted Solutions (0)

Answers (5)

Answers (5)

Avatar

Avatar
Validate 50
Level 6
cquser1
Level 6

Likes

75 likes

Total Posts

313 posts

Correct Reply

15 solutions
Top badges earned
Validate 50
Validate 25
Validate 10
Validate 1
Give Back 50
View profile

Avatar
Validate 50
Level 6
cquser1
Level 6

Likes

75 likes

Total Posts

313 posts

Correct Reply

15 solutions
Top badges earned
Validate 50
Validate 25
Validate 10
Validate 1
Give Back 50
View profile
cquser1
Level 6

08-06-2017

Hi,

Can you please try below and see if it helps.

1]Create user

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

 

  2]Add property

  curl -u admin:admin -Fprofile/age=25 http://localhost:4502/home/users/s/sample.rw.html

Avatar

Avatar
Validate 10
Level 2
Rui_J
Level 2

Likes

4 likes

Total Posts

39 posts

Correct Reply

1 solution
Top badges earned
Validate 10
Validate 1
Boost 3
Boost 1
Affirm 1
View profile

Avatar
Validate 10
Level 2
Rui_J
Level 2

Likes

4 likes

Total Posts

39 posts

Correct Reply

1 solution
Top badges earned
Validate 10
Validate 1
Boost 3
Boost 1
Affirm 1
View profile
Rui_J
Level 2

08-06-2017

This is exactly what I wrote in the first thread. And it does not work.

curl -u admin:admin -FcreateUser= -FauthorizableId=testuser -Frep:password=testuser -Fprofile/age@TypeHint=Long -Fprofile/age=30  -FintermediatePath="/home/users/test/" http://localhost:4501/libs/granite/security/post/authorizables

This command puts age (String) = 30 and age@TypeHint  (String) = "Long" in the user profile.

Avatar

Avatar
Establish
Community Manager
kautuk_sahni
Community Manager

Likes

1,127 likes

Total Posts

6,121 posts

Correct Reply

1,144 solutions
Top badges earned
Establish
Coach
Originator
Contributor 2
Contributor
View profile

Avatar
Establish
Community Manager
kautuk_sahni
Community Manager

Likes

1,127 likes

Total Posts

6,121 posts

Correct Reply

1,144 solutions
Top badges earned
Establish
Coach
Originator
Contributor 2
Contributor
View profile
kautuk_sahni
Community Manager

08-06-2017

-Fproperty-name@TypeHint="Long"

~kautuk

Avatar

Avatar
Validate 10
Level 2
Rui_J
Level 2

Likes

4 likes

Total Posts

39 posts

Correct Reply

1 solution
Top badges earned
Validate 10
Validate 1
Boost 3
Boost 1
Affirm 1
View profile

Avatar
Validate 10
Level 2
Rui_J
Level 2

Likes

4 likes

Total Posts

39 posts

Correct Reply

1 solution
Top badges earned
Validate 10
Validate 1
Boost 3
Boost 1
Affirm 1
View profile
Rui_J
Level 2

08-06-2017

I would like profile/age to be a Long type "30" instead of a String typed "30" in AEM when I create the user using curl command. How can I do this?

I know @TypeHint is a way, but not sure how to use when I call create user in http://localhost:4501/libs/granite/security/post/authorizables

Avatar

Avatar
Establish
Community Manager
kautuk_sahni
Community Manager

Likes

1,127 likes

Total Posts

6,121 posts

Correct Reply

1,144 solutions
Top badges earned
Establish
Coach
Originator
Contributor 2
Contributor
View profile

Avatar
Establish
Community Manager
kautuk_sahni
Community Manager

Likes

1,127 likes

Total Posts

6,121 posts

Correct Reply

1,144 solutions
Top badges earned
Establish
Coach
Originator
Contributor 2
Contributor
View profile
kautuk_sahni
Community Manager

08-06-2017

Just try this separately:-

Create a new User

curl -u admin:admin -FcreateUser= -FauthorizableId=hashim -Frep:password=hashim 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

curl -u admin:admin -FcreateUser=testuser -FauthorizableId=hashimkhan -Frep:password=hashimkhan -Fprofile/gender=male http://localhost:4502/libs/granite/security/post/authorizables

~kautuk