Renewing token with different information

Hello can someone help me with something about Keycloak/OIDC?

I need to renew a token overriding some information from it.

Nowadays when you logged in the user has to choose a locale and it is part of the token, but the user can change to another locale so we would like to refresh the token with the newly selected locale in the same session

Any idea how can I achieve this? I thought that calling the /auth endpoint with prompt=none and id_token_hint= and sending in the request the parameter of the new instute I could intercept this in the request in keycloak and update the session and set the new institute. But I am receiving the error “?error=login_required”

So I am not sure if this would be the correct path

Thanks in advance.

1 Like

I have written my endpoint setting the information in the Session Note following this example:

And afterwards configure the Mappers needed in the client scope to include the information in the access token.