[keycloak-user] Session destruction listener
Stian Thorgersen
stian at redhat.com
Mon Oct 13 07:59:47 EDT 2014
Hi,
We don't have a Spring adapter yet. If we did it would destroy the session on logout, which would fire the SessionDestroyedEvent.
----- Original Message -----
> From: "Jason Rodis" <jasrodis at gmail.com>
> To: keycloak-user at lists.jboss.org
> Sent: Monday, 13 October, 2014 1:44:48 PM
> Subject: [keycloak-user] Session destruction listener
>
> 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
>
> _______________________________________________
> keycloak-user mailing list
> keycloak-user at lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/keycloak-user
More information about the keycloak-user
mailing list