No support for Locale/Timezone?

Using JMIX 2.1.1, it seems that the locale claims is not used to set the ClientDetails.
In LoginViewSupport, the following code is present:

        ClientDetails clientDetails = ClientDetails.builder()
                .locale(locale != null ? locale : getDefaultLocale())
                .scope(SecurityScope.UI)
                .sessionId(request.getSession().getId())
                .timeZone(timeZone == null ? getDeviceTimeZone() : timeZone)
                .build();

        authenticationToken.setDetails(clientDetails);

I do not see similar code in JmixJwtAuthenticationConverter where the JmixJwtAuthenticationToken is created.

I also remark that, despite providing a “locale” claims, it does not change the language of the application. I suspect that the Timezone is equally ignored.
Am I missing something?

Hi,

This topic contains instructions how to apply a locale from keycloak.

1 Like

Thanks for your fast answer. Are you planning to add this to the documentation (I see there are some work not merged yet in the documentation commit 76f0195), or do you want me to try to propose a PR?

Do we hve something similar for the timezone?

I guess you should only make your User class implement the io.jmix.core.HasTimeZone interface and ensure that the timeZoneId attribute is set in the user mapper.

You may debug the io.jmix.core.security.impl.CurrentAuthenticationImpl#getTimeZone method to see where timeZone value is evaluated from.

1 Like