How to read id(9wMp6sGyejwQn-rzopsh) based on the user login programatically | Adobe Higher Education
Skip to main content
Level 2
July 19, 2021
해결됨

How to read id(9wMp6sGyejwQn-rzopsh) based on the user login programatically

  • July 19, 2021
  • 1 답변
  • 531 조회

Can you please help me with how to read id(9wMp6sGyejwQn-rzopsh) based on the user login. How to EX: If admin user login then need to display this id: 9wMp6sGyejwQn-rzopsh

 

 

@bimmiso@kiran_vedantam

이 주제는 답변이 닫혔습니다.
최고의 답변: Dipti_Chauhan

Hi @kotireddy4b1 

 You should be simple able to get it from Authorizable 

Sample code snippet:

Session session = resourceResolver.adaptTo(Session.class); UserManager userManager = resourceResolver.adaptTo(UserManager.class); Authorizable auth = userManager.getAuthorizable(session.getUserID());

 from this you can simply get id or path of logged in user.

 

Thanks

Dipti

1 답변

Dipti_Chauhan
Community Advisor
Community Advisor
July 19, 2021

Hi @kotireddy4b1 

 You should be simple able to get it from Authorizable 

Sample code snippet:

Session session = resourceResolver.adaptTo(Session.class); UserManager userManager = resourceResolver.adaptTo(UserManager.class); Authorizable auth = userManager.getAuthorizable(session.getUserID());

 from this you can simply get id or path of logged in user.

 

Thanks

Dipti