How to get logged user session details in AEM | Community
Skip to main content
Level 3
November 22, 2018
Solved

How to get logged user session details in AEM

  • November 22, 2018
  • 1 reply
  • 1712 views

Hello All,

               I am trying to get logged in user session details in my java servlet like user name,password,group,permission and complete profile details.

In case of administrator logged in I am able get all details successfully but in case of other user I am getting error of "Anonymous ".

1.http://localhost:port/useradmin  AEM Page-  I have applied all r/w permission to my user.

2.By using AEM my user login token I have checked my rest API method call and I am able get user session details in this scenario also.

3.But when I am trying with same rest API method call from my HTML5 application I am facing the "Anonymous " error problem.

Thanks

Qamar

Best answer by Manu_Mathew_

@qamar_khan It may be because the session is not authenticated.

 

  • Ensuring proper authentication headers or cookies are sent.
  • Verifying CORS configuration.
  • Double-check user permissions for the servlet and relevant resources.

    Configure CORS in AEM:

    • Navigate to /system/console/configMgr.
    • Search for Adobe Granite Cross-Origin Resource Sharing Policy.
    • Add your HTML5 app's domain (e.g., http://your-app-domain.com) to the Allowed Origins list.
    • Enable Allow-Credentials.

 

1 reply

Manu_Mathew_
Community Advisor
Manu_Mathew_Community AdvisorAccepted solution
Community Advisor
November 26, 2024

@qamar_khan It may be because the session is not authenticated.

 

  • Ensuring proper authentication headers or cookies are sent.
  • Verifying CORS configuration.
  • Double-check user permissions for the servlet and relevant resources.

    Configure CORS in AEM:

    • Navigate to /system/console/configMgr.
    • Search for Adobe Granite Cross-Origin Resource Sharing Policy.
    • Add your HTML5 app's domain (e.g., http://your-app-domain.com) to the Allowed Origins list.
    • Enable Allow-Credentials.