Package org.keycloak.services.managers
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 Summary
Modifier and TypeMethodDescriptionstatic TokenVerifier.Predicate<org.keycloak.representations.AccessToken>check(KeycloakSession session) Creates a TokenVerifier.Predicate for grant type endpoint restriction validation.booleantest(org.keycloak.representations.AccessToken token)
-
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
- Specified by:
testin interfaceTokenVerifier.Predicate<org.keycloak.representations.AccessToken>- Throws:
VerificationException
-