Class JwtTypeValidator
java.lang.Object
org.springframework.security.oauth2.jwt.JwtTypeValidator
- All Implemented Interfaces:
OAuth2TokenValidator<Jwt>
A validator for the
typ header. Specifically for indicating the header values
that a given JwtDecoder will support.- Since:
- 6.5
-
Constructor Summary
ConstructorsConstructorDescriptionJwtTypeValidator(String... validTypes) JwtTypeValidator(Collection<String> validTypes) -
Method Summary
Modifier and TypeMethodDescriptionstatic JwtTypeValidatorjwt()Require that thetypheader beJWTor absentvoidsetAllowEmpty(boolean allowEmpty) Whether to allow thetypheader to be empty.Verify the validity and/or constraints of the provided OAuth 2.0 Token.
-
Constructor Details
-
JwtTypeValidator
-
JwtTypeValidator
-
-
Method Details
-
jwt
Require that thetypheader beJWTor absent -
setAllowEmpty
public void setAllowEmpty(boolean allowEmpty) Whether to allow thetypheader to be empty. The default value isfalse -
validate
Description copied from interface:OAuth2TokenValidatorVerify the validity and/or constraints of the provided OAuth 2.0 Token.- Specified by:
validatein interfaceOAuth2TokenValidator<Jwt>- Parameters:
token- an OAuth 2.0 token- Returns:
- OAuth2TokenValidationResult the success or failure detail of the validation
-