Login logout report of users

Hi,

Is there any plugin or documentation to track login logout of users and password reset history of users.

I tried user session plugin but it only shows only session id and time.

Hi Adnan,

Look at the authentication events and this forum discussion.

For password reset logging, perhaps you can use an EntityChangedEvent for your User entity.

Hi,

Getting below error during api call.

java.lang.ClassCastException: org.springframework.security.core.userdetails.User cannot be cast to com.entity.User
at com.listener.AuthenticationEventListener.onAuthenticationSuccess(AuthenticationEventListener.java:26)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)

This is what the beginning of my method looks like. I’m listening for the InteractiveAuthenticationSuccesEvent, but the other one is probably similar.

@EventListener
public void onInteractiveAuthenticationSuccess(InteractiveAuthenticationSuccessEvent event) {

    User user = (User) event.getAuthentication().getPrincipal();