Uploaded image for project: 'Red Hat build of Keycloak'
  1. Red Hat build of Keycloak
  2. RHBK-2991

Inconsistent "grant_types" vs "grantTypes" Naming Causes GrantTypeCondition to Always Fail [GHI#39296]

XMLWordPrintable

    • False
    • Hide

      None

      Show
      None
    • False

      Before reporting an issue

      [x] 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

      core

      Describe the bug

      There is a mismatch between the key used in the GrantTypeConditionFactory and the one expected by GrantTypeCondition, causing the condition to always fail at runtime.

      Because of this inconsistency:

      • When the condition is evaluated, it attempts to read grantTypes from the configuration, but the provided configuration only contains grant_types.
      • This results in null being assigned and the condition never being properly triggered.

      Version

      26.2.1

      Regression

      [ ] The issue is a regression

      Expected behavior

      When configuring a client policy with a GrantTypeCondition, the specified grant types should be correctly read from the configuration.

      The condition should match requests with the corresponding grant types and enforce the policy as configured.

      Actual behavior

      The condition always sees a null value for grant types because of the key mismatch.

      As a result, the GrantTypeCondition never triggers, and the client policy is not applied based on grant type.

      How to Reproduce?

      • Create a client policy with a condition based on grant types.
      • Attempt a client request that should match the condition.
      • Notice that the policy is not triggered, even though the conditions seem correctly configured.

      Anything else?

      No response

              Unassigned Unassigned
              pvlha Pavel Vlha
              Keycloak Core Clients
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

                Created:
                Updated:
                Resolved: