User information in Publish Enviroment in AEM 6.5 | Community
Skip to main content
Level 2
January 7, 2021
Solved

User information in Publish Enviroment in AEM 6.5

  • January 7, 2021
  • 4 replies
  • 1544 views

Hi Everyone,

 

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

 

Regards

Bikash Singh

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

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.

 

 

 

4 replies

New Member
January 7, 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", "");

Ankur_Khare
Community Advisor
Community Advisor
January 8, 2021

Yes  you can.

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

raj_mandalapu
raj_mandalapuAccepted solution
Level 7
January 8, 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.

 

 

 

joerghoh
Adobe Employee
Adobe Employee
January 8, 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.