Is there a built-in mechanism to propagate the selected login language on redirect to the client

GIVEN

  • a realm R with l10n enabled
  • a user successfully authenticates for a specific client (ie with an redirect URL)
  • the user selects a language (or just uses the default)

WHEN
the redirect to the client happens i would like to have that (changed/effective) kc_locale value added to the redirection URL so that the client is made aware of it.

is that possible OOTB with KC 26.0.5 ?
if yes: how ?
if not: how can i do this with custom logic/spi impls ?

I’m just answering this question because it follows the format with the GIVEN-WHEN-THEN syntax :grinning:

The standard profile scope [1] includes a mapper with the user locale attribute (or you can also create a specific scope for that).
Therefore, once the user is authenticated (I’m guessing you are implementing OIDC), the id_token will include the locale claim.

[1] Final: OpenID Connect Core 1.0 incorporating errata set 2

1 Like