-
Notifications
You must be signed in to change notification settings - Fork 7.9k
Description
Describe the bug
When the user is redirected back to the login page after entering their email in the "Forgot password" dialog, the language resets to the realm's default language, rather than using a previously set ui_locales parameter.
Version
17.0.1
Expected behavior
When being sent back to the login page after a reset password flow, the page should still be translated in the language that was requested via the ui_locales parameter.
Actual behavior
Instead, the language is reset to the default language of the selected realm.
How to Reproduce?
- Create a new realm and client with the authorization code flow, in this case, both named "test". Set the client's redirect_uri to "*".
- Enable "forgot password" on the realm
- Enable "Localization" on the realm, and select at least 2 languages (in this case, de and en, with the default language being de)
- Navigate to http://localhost:8080/auth/realms/test/protocol/openid-connect/auth?client_id=test&response_type=code&redirect_uri=https://google.com&ui_locales=en
- Click "Forgot Password?" and enter any email (an actual user is not required to exist)
- After submitting the email, the language of the form will have switched to German, rather than the requested English
Anything else?
When using the language switcher in the login form to switch the language to english, keycloak redirects the user and appends the kc_locale parameter. This parameter is correctly remembered, and even after a password reset, when the user gets redirected back to the login page, the page is in the expected language.
As a workaround, we tried appending kc_locale directly to the auth URL, like http://localhost:8080/auth/realms/test/protocol/openid-connect/auth?client_id=test&response_type=code&redirect_uri=https://google.com&ui_locales=en&kc_locale=en, as well as http://localhost:8080/auth/realms/test/protocol/openid-connect/auth?client_id=test&response_type=code&redirect_uri=https://google.com&kc_locale=en, but both of these seem to be ignored. They are only used when the user manually selects a language using the language selector.