How do i tarck login and logout of an AEM user in author instance ? | Community
Skip to main content
adivj95
Level 2
August 28, 2023
Solved

How do i tarck login and logout of an AEM user in author instance ?

  • August 28, 2023
  • 2 replies
  • 1377 views

Hi Community,

 

I have a requirement where we want to track login and logout of author users in the AEM author instance , How can we do that ?

 

I tried creating a sling filter where we can check for login and logout URL, for this i am targeting j_security_check as login URL and /system/sling/logout as logout URL
I am able to get logout URL but not able to get login URL in sling filter

 

Please Help me with this or suggest some ideas to track login activity for a user 

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 sherinregi-1

Hi @adivj95 

You can try implementing authenticationinfopostprocessor which will be executed after authentication has been performed.

Please find a similar implementation in the below post. When  info.getUser returns a value there you have add the custom logic . 

 

https://sling.apache.org/apidocs/sling6/org/apache/sling/auth/core/spi/AuthenticationInfoPostProcessor.html

 

https://medium.com/tech-learnings/adobe-experience-manager-reporting-on-users-last-login-date-e2035021cb9e

 

Hope this helps

2 replies

arunpatidar
Community Advisor
Community Advisor
August 28, 2023
adivj95
adivj95Author
Level 2
August 28, 2023

@arunpatidar 
already check this, as i have mentioned in my question , I am not able to get j_security_check url in my filter

sherinregi-1
Community Advisor
sherinregi-1Community AdvisorAccepted solution
Community Advisor
August 28, 2023

Hi @adivj95 

You can try implementing authenticationinfopostprocessor which will be executed after authentication has been performed.

Please find a similar implementation in the below post. When  info.getUser returns a value there you have add the custom logic . 

 

https://sling.apache.org/apidocs/sling6/org/apache/sling/auth/core/spi/AuthenticationInfoPostProcessor.html

 

https://medium.com/tech-learnings/adobe-experience-manager-reporting-on-users-last-login-date-e2035021cb9e

 

Hope this helps

adivj95
adivj95Author
Level 2
September 23, 2023

Thank you, @sherinregi-1 , for providing this excellent solution.