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

User information in Publish Enviroment in AEM 6.5

Avatar

Avatar
Validate 1
Level 1
bikash_kumar306
Level 1

Likes

0 likes

Total Posts

10 posts

Correct Reply

0 solutions
Top badges earned
Validate 1
View profile

Avatar
Validate 1
Level 1
bikash_kumar306
Level 1

Likes

0 likes

Total Posts

10 posts

Correct Reply

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

07-01-2021

Hi Everyone,

 

Can we get user details like mail etc through api in publish environment. 

 

Regards

Bikash Singh

Accepted Solutions (1)

Accepted Solutions (1)

Avatar

Avatar
Validate 1
MVP
raj_mandalapu
MVP

Likes

125 likes

Total Posts

203 posts

Correct Reply

72 solutions
Top badges earned
Validate 1
Contributor
Shape 1
Give Back 5
Give Back 3
View profile

Avatar
Validate 1
MVP
raj_mandalapu
MVP

Likes

125 likes

Total Posts

203 posts

Correct Reply

72 solutions
Top badges earned
Validate 1
Contributor
Shape 1
Give Back 5
Give Back 3
View profile
raj_mandalapu
MVP

08-01-2021

Hi Bikash,

 

There is no out of box functionality to expose user details via rest API's, you need to write custom logic.

 

Things you need to consider:

You are trying to expose user details, as it is PII data,  so you need to consider security, you must enable authentication.

If security is not a concern then you can also create servlets and expose user details in JSON format.

You can use watch below link to get some idea on exposing aem content via rest ap's

https://www.youtube.com/watch?v=Bzdd298ii_Y

You can integrate AEM with Spring and expose data.

 

 

 

Answers (3)

Answers (3)

Avatar

Avatar
Coach
Employee
Jörg_Hoh
Employee

Likes

1,133 likes

Total Posts

3,161 posts

Correct Reply

1,079 solutions
Top badges earned
Coach
Give back 600
Ignite 5
Ignite 3
Ignite 1
View profile

Avatar
Coach
Employee
Jörg_Hoh
Employee

Likes

1,133 likes

Total Posts

3,161 posts

Correct Reply

1,079 solutions
Top badges earned
Coach
Give back 600
Ignite 5
Ignite 3
Ignite 1
View profile
Jörg_Hoh
Employee

08-01-2021

Instead of the how, the question is rather if you want to maintain user information on publish at all? The straight-forward way of using JCR users very likely doesn't scale in terms of performance, and also you need think about how you synchronize changes amongst all publish instances.

 

Avatar

Avatar
Ignite 1
MVP
Ankur_Khare
MVP

Likes

159 likes

Total Posts

370 posts

Correct Reply

58 solutions
Top badges earned
Ignite 1
Validate 10
Validate 1
Give Back 50
Give Back 5
View profile

Avatar
Ignite 1
MVP
Ankur_Khare
MVP

Likes

159 likes

Total Posts

370 posts

Correct Reply

58 solutions
Top badges earned
Ignite 1
Validate 10
Validate 1
Give Back 50
Give Back 5
View profile
Ankur_Khare
MVP

07-01-2021

Yes  you can.

But how to access it depends on how the user details you are saving.

Avatar

Avatar
Boost 1
Level 1
san3ket
Level 1

Likes

2 likes

Total Posts

2 posts

Correct Reply

0 solutions
Top badges earned
Boost 1
View profile

Avatar
Boost 1
Level 1
san3ket
Level 1

Likes

2 likes

Total Posts

2 posts

Correct Reply

0 solutions
Top badges earned
Boost 1
View profile
san3ket
Level 1

07-01-2021

you can use UserManager API to get the user details.

 

Ex: 

final UserManager userManager = resource.adaptTo(UserManager.class);

ValueMap properties = resource.getValueMap();

String emailId=properties.get("profile/email", "");