[keycloak-user] Keycloak events related to token/session expiry

Tomas Kyjovsky tkyjovsk at redhat.com
Tue Jan 15 14:18:37 EST 2019


Hello Vineet,

Unfortunatelly Keycloak doesn't support generating token/session expiration events at this time, only for direct user-initiated logout.

I'm not sure what category this event would fall into. The login events are related to user-initiated actions (EventType.LOGOUT), and the admin events are specific to administrative operations.
This type of event isn't initiated by any user. It would have to be generated by a periodic task such as the one which removes the expired user sessions once in a while (ClearExpiredUserSessions.java in keycloak/services module).

Perhaps the best way is to create a feature request in the project's issue tracker so that the developers can consider how/if this can be solved.

https://issues.jboss.org/projects/KEYCLOAK/


Regards,
Tomas

----- Original Message -----
> My goal is to implement the event listener SPI to listen for logout
> and session expiration events so that I could update a custom
> attribute in the user model.
> 
> Does Keycloak generate any events that can be listened to, in order to
> detect if the token or associated session has expired?
> 
> I've looked at the events listed in the EventType enumeration, and
> none of them seem to be related to the specific expiration event. I
> also enabled event logging, and no events related to expiry seemed to
> appear in the Keycloak administration console; logout events were
> generated when users signed out of the client app, but no event
> appeared to generated on expiry.
> 
> I'm using Keycloak 3.4.3, but I suppose an answer for Keycloak 4.8
> will be good enough for me.
> 
> Thanks,
> Vineet
> _______________________________________________
> 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