I have a requirement where we need to get the user last login on AEM server i.e. User last access date & time. We are going with AEM-SAML integration for user authentication not a custom login approach. Could you let me know is there any way through which we can get above details i.e last login & no.of logins of user. Let me know if do we need to follow any approach for getting above details.
It won't impact the existing AEM default login functionality. All you need to do is extends the AuthenticationHandler and override the method extractCredentials and write the logic the persist the login count for user.
There's a OOTB report to generate Users report but it doesn't have information related to login or number of times login in options.
And, I don't think there's such option available OOTB to get the such details.
For that, you can write custom code (a servlet) to get last login (date/time) for user. It's stored under path /home/users/<user>/.tokens/<last login node>
<last login node> - node name is the last login date and time. However, it's just last login information. You still won't find number of times user logged in information. For that, you can write custom authentication handler and once a user log-in, you can save the count in user profile and then generates the report.