Class JwtClaimValidator<T>
- java.lang.Object
-
- org.springframework.security.oauth2.jwt.JwtClaimValidator<T>
-
- All Implemented Interfaces:
OAuth2TokenValidator<Jwt>
public final class JwtClaimValidator<T> extends java.lang.Object implements OAuth2TokenValidator<Jwt>
Validates a claim in aJwt
against a providedPredicate
- Since:
- 5.3
-
-
Constructor Summary
Constructors Constructor Description JwtClaimValidator(java.lang.String claim, java.util.function.Predicate<T> test)
Constructs aJwtClaimValidator
using the provided parameters
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description OAuth2TokenValidatorResult
validate(Jwt token)
Verify the validity and/or constraints of the provided OAuth 2.0 Token.
-
-
-
Constructor Detail
-
JwtClaimValidator
public JwtClaimValidator(java.lang.String claim, java.util.function.Predicate<T> test)
Constructs aJwtClaimValidator
using the provided parameters- Parameters:
claim
- - is the name of the claim inJwt
to validate.test
- - is the predicate function for the claim to test against.
-
-
Method Detail
-
validate
public OAuth2TokenValidatorResult validate(Jwt token)
Description copied from interface:OAuth2TokenValidator
Verify the validity and/or constraints of the provided OAuth 2.0 Token.- Specified by:
validate
in interfaceOAuth2TokenValidator<T>
- Parameters:
token
- an OAuth 2.0 token- Returns:
- OAuth2TokenValidationResult the success or failure detail of the validation
-
-