Skip to content

Logout URL does not allow OIDC response parameters in its redirect_url #51712

Closed

Description

@djoho

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

  1. added theissue type on Aug 13, 2026
  2. added
    kind/bug
    on Aug 13, 2026
  3. added
    area/oidc
    on Aug 13, 2026
  4. CGeorg-ci commented on Aug 20, 2026

    @CGeorg-ci

    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

  5. SebastianKrell commented on Aug 20, 2026

    @SebastianKrell

    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:

    • a configurable feature flag to temporarily retain the previous behavior,
    • an option to selectively relax the validation for post-logout redirect URIs if technically feasible, or
    • a migration path with a longer deprecation period.

    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.

  6. added
    priority/blocker
    and removed on Aug 21, 2026
  7. added this to the 26.8.0 milestone on Aug 21, 2026
  8. 17 remaining items

  9. added a commit that references this issue on Aug 28, 2026
    d16bb5b
  10. added a commit that references this issue on Aug 28, 2026
    fa6eb4e
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

Type

Fields

No fields configured for bug.

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions