[keycloak-user] How to add custom information (a session note) in UserSession

Marek Posolda mposolda at redhat.com
Wed Feb 14 17:10:54 EST 2018


If you want to add the information during authentication, then you may 
implement custom Authenticator (See docs and examples for Authentication 
SPI) and call AuthenticationSessionModel.setUserSessionNote. If you want 
after authentication, then maybe invoke REST endpoint for that (See docs 
and examples for REST SPI) with the token, which will need to be 
verified in your REST endpoint and then can be used to load the proper 
userSession (tokens has the info in the session_state claim).

Marek

On 12/02/18 15:03, Logan HAUSPIE wrote:
> Hi there,
>
> I would like to know what I have to do (server-devlopment) to add custom
> data in the user session.
>
> My purpose is to call an External Web Service to retrieve some data and add
> it to the User Session.
> This returned data will be different from one call to another. So it's
> important for me to 'store' it in the session and not in the user.
>
> Which Provider do I need to implement to do that ?
>
> Thanks in advance.
>
> *Logan HAUSPIE*
> _______________________________________________
> 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