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 JwtTypeValidator
jwt()
Require that thetyp
header beJWT
or absentvoid
setAllowEmpty
(boolean allowEmpty) Whether to allow thetyp
header 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 thetyp
header beJWT
or absent -
setAllowEmpty
public void setAllowEmpty(boolean allowEmpty) Whether to allow thetyp
header to be empty. The default value isfalse
-
validate
Description copied from interface:OAuth2TokenValidator
Verify the validity and/or constraints of the provided OAuth 2.0 Token.- Specified by:
validate
in interfaceOAuth2TokenValidator<Jwt>
- Parameters:
token
- an OAuth 2.0 token- Returns:
- OAuth2TokenValidationResult the success or failure detail of the validation
-