[keycloak-user] Session destruction listener

Jason Rodis jasrodis at gmail.com
Mon Oct 13 08:02:12 EDT 2014


Hi,

Thanks for your quick reply!
Is it something that it’s going to be implemented? Is there any alternative with the rest API that you offer?

Thanks again,
Jason

On Oct 13, 2014, at 2:44 PM, Jason Rodis <jasrodis at gmail.com> wrote:

> 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

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/keycloak-user/attachments/20141013/627e17a0/attachment-0001.html 


More information about the keycloak-user mailing list