how to get uesr details from client context in server side | Community
Skip to main content
nani_nani
October 16, 2015
Solved

how to get uesr details from client context in server side

  • October 16, 2015
  • 1 reply
  • 571 views

Hi,

I would like know how to get the user from client context in my java service.

  1. Is there a way I could pass CQ_Analytics.ProfileDataMgr.getProperty('authorizableId', true) to my java service class. 
  2. or get the client context user details in my Java Service class.

Please let me know if you are looking for more details.

 

Thanks

Nani

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 joerghoh

That's quite simple, as it is teh user, which is executing the request; so somehting like

request.getUserPrincipal()

from the Java servlet API should do the trick. But be aware: The clientside code is always executed in the browser; but when all the responses the client browser made to the server, are actually delivered from a cache, your serverside code is never executed. So if you want to cache your pages, you should not rely on your serverside code.

kind regards,
Jörg

1 reply

joerghoh
Adobe Employee
joerghohAdobe EmployeeAccepted solution
Adobe Employee
October 16, 2015

That's quite simple, as it is teh user, which is executing the request; so somehting like

request.getUserPrincipal()

from the Java servlet API should do the trick. But be aware: The clientside code is always executed in the browser; but when all the responses the client browser made to the server, are actually delivered from a cache, your serverside code is never executed. So if you want to cache your pages, you should not rely on your serverside code.

kind regards,
Jörg