-
Notifications
You must be signed in to change notification settings - Fork 36
Description
Before reporting an issue
- I have read and understood the above terms for submitting issues, and I understand that my issue may be closed without action if I do not follow them.
Area
adapter/javascript
Describe the bug
When initializing keycloak-js (latest version) with the locale option and onLoad: 'check-sso', the adapter does not include the ui_locales query parameter in the authentication request. This is inconsistent with the behavior for onLoad: 'login-required', where ui_locales is correctly set. According to OIDC 1.0 specification section 3.1.2.1, the ui_locales parameter should be supported in all authentication requests.
Environment:
- Keycloak server: latest
keycloak-js: latest- Browser: Chrome 125
- OS: Windows 11
Version
26.3.0
Regression
- The issue is a regression
Expected behavior
The authentication request should include the ui_locales parameter (e.g., ui_locales=fr) whenever the locale option is set, regardless of whether onLoad is 'login-required' or 'check-sso'.
Actual behavior
When using onLoad: 'check-sso', the authentication request sent to Keycloak does not include the ui_locales parameter, even if the locale option is set. This results in the login screen not being localized according to the specified locale.
In contrast, when using onLoad: 'login-required', the ui_locales parameter is correctly included.
How to Reproduce?
- Install and configure the latest
keycloak-jsnpm package. - Initialize Keycloak with:
const keycloak = new Keycloak({ url: 'https://<keycloak-server>/auth', realm: 'myrealm', clientId: 'myclient', }); keycloak.init({ onLoad: 'check-sso', locale: 'fr', });
- Check the authentication request sent to the Keycloak server.
- Observe that the
ui_locales=frparameter is missing from the query string.
Anything else?
This inconsistency prevents applications using check-sso from correctly localizing the login screen. According to the OIDC specification, this parameter should be available for all authentication flows.