Good morning,

I am trying to set up an application that uses:

1. Spring 3.2.x

I used to have spring security for the authentication of the users, and I could have a logout listener, triggering the SessionDestroyedEvent like this (whenever a session was destroyed) :

@Service
public class LogoutListener implements ApplicationListener<SessionDestroyedEvent> {

    @Autowired
    private SessionRegistryImpl sessionRegistry;

    @Override
    public void onApplicationEvent(SessionDestroyedEvent event) {
        List<SecurityContext> lstSecurityContext = event.getSecurityContexts();
        AuthenticateUser authenticateUser;
        for (SecurityContext securityContext : lstSecurityContext) {
            authenticateUser = (AuthenticateUser) securityContext.getAuthentication().getPrincipal();
            logger.trace("Current session destroyed from user [{}]", authenticateUser.getEmail());


            //Handle the session destruction event..

        }
    }
}


Is there any way I could have that functionality with Keycloak?

Thanks in advance,
Jason