Class GrantTypeEndpointRestrictionValidator

java.lang.Object
org.keycloak.services.managers.GrantTypeEndpointRestrictionValidator
All Implemented Interfaces:
TokenVerifier.Predicate<org.keycloak.representations.AccessToken>

public class GrantTypeEndpointRestrictionValidator extends Object implements TokenVerifier.Predicate<org.keycloak.representations.AccessToken>
Validates that tokens are only used on endpoints allowed by their grant type. This ensures Pre-Authorized Code tokens are restricted to the credential endpoint, and other grant types only access their intended endpoints.
  • Method Details

    • check

      public static TokenVerifier.Predicate<org.keycloak.representations.AccessToken> check(KeycloakSession session)
      Creates a TokenVerifier.Predicate for grant type endpoint restriction validation. Can be used with TokenVerifier.withChecks() for inline verification.
      Parameters:
      session - The Keycloak session
      Returns:
      A predicate that validates grant type restrictions
    • test

      public boolean test(org.keycloak.representations.AccessToken token) throws VerificationException
      Specified by:
      test in interface TokenVerifier.Predicate<org.keycloak.representations.AccessToken>
      Throws:
      VerificationException