Skip to content

ui_locales parameter is not set with onLoad: 'check-sso' in keycloak-js adapter #136

@Redfish90

Description

@Redfish90

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?

  1. Install and configure the latest keycloak-js npm package.
  2. Initialize Keycloak with:
    const keycloak = new Keycloak({
      url: 'https://<keycloak-server>/auth',
      realm: 'myrealm',
      clientId: 'myclient',
    });
    
    keycloak.init({
      onLoad: 'check-sso',
      locale: 'fr',
    });
  3. Check the authentication request sent to the Keycloak server.
  4. Observe that the ui_locales=fr parameter 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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    questionFurther information is requested

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions