Repository navigation
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
oidc
Describe the bug
We have a legacy richclient application that has to use the Edge WebView for Keycloak authentication. There we have a function to login as a different user. This is implemented with a logout url that contains a oidc state parameter in the post_logout_redirect_url for the new login.
The post logout redirect url looks like: "post_logout_redirect_uri=https://myhost/auth/realms/uka/protocol/openid-connect/auth?response_type=code%26client_id=client%26redirect_uri=urn:ietf:wg:oauth:2.0:oob%26state=de43a890-30ae-4a76-bb7f-d4d090164d5a%26login=true%26scope=openid%26kc_idp_hint=nosso"
Since #49430 it is no longer possible to provide a state parameter in the redirect_url. Therefore we get the "Invalid redirect uri" message.
Version
26.7.1
Regression
- The issue is a regression
Expected behavior
I understand the need for #49430.
But would it be possible to just fail the validation if the oidc parameters are effectively duplicated? This way we would still be able to provide this login as a different user functionality.
The expected behaviour would be that the logout redirect url is valid and the new login screen works.
Actual behavior
The post logout redirect url looks like: "post_logout_redirect_uri=https://myhost/auth/realms/uka/protocol/openid-connect/auth?response_type=code%26client_id=client%26redirect_uri=urn:ietf:wg:oauth:2.0:oob%26state=de43a890-30ae-4a76-bb7f-d4d090164d5a%26login=true%26scope=openid%26kc_idp_hint=nosso"
In the Keycloak log the following entries appear:
2026-08-13 18:58:14,490 WARN [org.keycloak.protocol.oidc.utils.RedirectUtils] (executor-thread-179) Redirect URI rejected: contains forbidden OIDC parameter 'state' in query string: scheme=https, host=myhost, path=/auth/realms/uka/protocol/openid-connect/auth
2026-08-13 18:58:14,495 WARN [org.keycloak.events] (executor-thread-179) type="LOGOUT_ERROR", realmId="483ac616-8077-4572-9602-c69dc3500ae9", realmName="test", clientId="client", userId="null", ipAddress="10.0.0.2", error="invalid_redirect_uri", redirect_uri="https://myhost/auth/realms/uka/protocol/openid-connect/auth?response_type=code&client_id=client&redirect_uri=urn:ietf:wg:oauth:2.0:oob&state=f818e74c-c125-4e9e-9a8c-a49a992e9248&login=true&scope=openid&kc_idp_hint=nosso"
Since #49430 it is no longer possible to provide a state parameter in the redirect_url. Therefore we get the "Invalid redirect uri" message.
How to Reproduce?
Use a post logout redirect uri with a state parameter like: "post_logout_redirect_uri=https://myhost/auth/realms/uka/protocol/openid-connect/auth?response_type=code%26client_id=client%26redirect_uri=urn:ietf:wg:oauth:2.0:oob%26state=de43a890-30ae-4a76-bb7f-d4d090164d5a%26login=true%26scope=openid%26kc_idp_hint=nosso"
Anything else?
No response
Activity
CGeorg-ci commentedon Aug 20, 2026
Rejecting redirect URIs with the state parameter is also an issue when using mobile apps that have been historically using the state paramter during login. It is not done with changing the redirect uri when initiating the login when the app actually checks the state. so an update to the app code is required and this requres all users to update. With a large mobile base this takes a while during which an update of KC is not possible. With the recently fixed pw reset updating KC is without an option and thus breaking the existing mobile apps.
Therefore I see this as an urgent topic to work on
SebastianKrell commentedon Aug 20, 2026
We are also affected by this change.
After evaluating the CVE fix, we discovered that several existing post-logout redirect flows rely on redirect URIs that contain OIDC-related parameters. These flows have been working reliably for a long time and are deeply integrated into existing applications and mobile clients.
The introduced validation effectively turns the security fix into a breaking change for us. Updating all affected clients is not something that can be done quickly, especially for deployed mobile applications where upgrade adoption is outside of our control.
As a consequence, we had to stop our planned Keycloak upgrade and temporarily disable password reset functionality because the affected flows could no longer be used safely in production.
We understand and support the security motivation behind the change. However, from an operational perspective, it would be very helpful if there was either:
From our perspective, this is not a corner case. Existing deployments may have relied on this behavior for years, and remediation can require coordinated changes across multiple applications that cannot always be updated immediately.
We would strongly support making this behavior configurable to enable a controlled migration while still allowing organizations to address the security concern.
17 remaining items
Fixes #51712 by improving post-logout redirect URI validation. (#51909)
Fixes #51712 by improving post-logout redirect URI validation. (#51909)