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

curl command to fetch user path in JCR by Login id ?

Avatar

Avatar
Validate 1
Level 1
bsr78033597
Level 1

Likes

0 likes

Total Posts

11 posts

Correct Reply

0 solutions
Top badges earned
Validate 1
View profile

Avatar
Validate 1
Level 1
bsr78033597
Level 1

Likes

0 likes

Total Posts

11 posts

Correct Reply

0 solutions
Top badges earned
Validate 1
View profile
bsr78033597
Level 1

23-07-2020

Hi, is there a curl command to fetch a User's JCR path by Login Id? The curl command to change a user's password requires his JCR path (e.g. below), so I'm thinking to fetch user's JCR path by Id, in the prior step. Please suggest other alternate approach, if any.

 

e.g. curl -u testuser:OLD_PWD -F rep:password=”NEW_PWD” http://localhost:4502/home/users/t/testuser.rw.html

 

Thanks.

curl User Management

Accepted Solutions (1)

Accepted Solutions (1)

Avatar

Avatar
Establish
MVP
Nupur_Jain
MVP

Likes

165 likes

Total Posts

186 posts

Correct Reply

76 solutions
Top badges earned
Establish
Ignite 1
Give Back 5
Give Back 3
Give Back 25
View profile

Avatar
Establish
MVP
Nupur_Jain
MVP

Likes

165 likes

Total Posts

186 posts

Correct Reply

76 solutions
Top badges earned
Establish
Ignite 1
Give Back 5
Give Back 3
Give Back 25
View profile
Nupur_Jain
MVP

23-07-2020

Hi @bsr78033597 

 

You can use Query builder path query to access user path by login ID. Find the example below

 

curl -u admin:admin "http://localhost:4502/bin/querybuilder.json?path=/home/users&property=rep:authorizableId&property.value=admin"

 

The query will return data in json format like 

 

{
"success": true,
"results": 1,
"total": 1,
"more": false,
"offset": 0,
"hits": [
{
"path": "/home/users/f/fKws0F07AYaqkqiiKTQs",
"excerpt": "",
"name": "fKws0F07AYaqkqiiKTQs",
"title": "fKws0F07AYaqkqiiKTQs",
"created": "2020-03-26 13:15:40"
}
]
}

 

Hope it helps!

Thanks!

Nupur

Answers (1)

Answers (1)

Avatar

Avatar
Coach
MVP
Arun_Patidar
MVP

Likes

1,428 likes

Total Posts

3,300 posts

Correct Reply

937 solutions
Top badges earned
Coach
Contributor 2
Ignite 10
Give Back 700
Boost 1000
View profile

Avatar
Coach
MVP
Arun_Patidar
MVP

Likes

1,428 likes

Total Posts

3,300 posts

Correct Reply

937 solutions
Top badges earned
Coach
Contributor 2
Ignite 10
Give Back 700
Boost 1000
View profile
Arun_Patidar
MVP

24-07-2020

User info is exposed by /libs/cq/security/userinfo.json

e.g.
{"userID":"anonymous","userName":"anonymous","userName_xss":"anonymous","home":"/home/users/a/anonymous","impersonated":false,"allowedApps":[],"preferences":{}}