Class JwtValidationException
java.lang.Object
java.lang.Throwable
java.lang.Exception
java.lang.RuntimeException
org.springframework.security.oauth2.jwt.JwtException
org.springframework.security.oauth2.jwt.BadJwtException
org.springframework.security.oauth2.jwt.JwtValidationException
- All Implemented Interfaces:
- Serializable
An exception that results from an unsuccessful 
OAuth2TokenValidatorResult- Since:
- 5.1
- See Also:
- 
Constructor SummaryConstructorsConstructorDescriptionJwtValidationException(String message, Collection<org.springframework.security.oauth2.core.OAuth2Error> errors) Constructs aJwtValidationExceptionusing the provided parameters While eachOAuth2Errordoes contain an error description, this constructor can take an overarching description that encapsulates the composition of failures That said, it is appropriate to pass one of the messages from the error list in as the exception description, for example:
- 
Method SummaryModifier and TypeMethodDescriptionCollection<org.springframework.security.oauth2.core.OAuth2Error>Return the list ofOAuth2Errors associated with this exceptionMethods inherited from class java.lang.ThrowableaddSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
- 
Constructor Details- 
JwtValidationExceptionpublic JwtValidationException(String message, Collection<org.springframework.security.oauth2.core.OAuth2Error> errors) Constructs aJwtValidationExceptionusing the provided parameters While eachOAuth2Errordoes contain an error description, this constructor can take an overarching description that encapsulates the composition of failures That said, it is appropriate to pass one of the messages from the error list in as the exception description, for example:if ( result.hasErrors() ) { Collection<OAuth2Error> errors = result.getErrors(); throw new JwtValidationException(errors.iterator().next().getDescription(), errors); }- Parameters:
- message- - the exception message
- errors- - a list of- OAuth2Errors with extra detail about the validation result
 
 
- 
- 
Method Details- 
getErrorsReturn the list ofOAuth2Errors associated with this exception- Returns:
- the list of OAuth2Errors associated with this exception
 
 
-