public class JwtValidationException extends BadJwtException
OAuth2TokenValidatorResult
Constructor and Description |
---|
JwtValidationException(java.lang.String message,
java.util.Collection<OAuth2Error> errors)
Constructs a
JwtValidationException using the provided parameters
While each OAuth2Error does 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: |
Modifier and Type | Method and Description |
---|---|
java.util.Collection<OAuth2Error> |
getErrors()
Return the list of
OAuth2Error s associated with this exception |
public JwtValidationException(java.lang.String message, java.util.Collection<OAuth2Error> errors)
JwtValidationException
using the provided parameters
While each OAuth2Error
does 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); }
message
- - the exception messageerrors
- - a list of OAuth2Error
s with extra detail about the
validation resultpublic java.util.Collection<OAuth2Error> getErrors()
OAuth2Error
s associated with this exceptionOAuth2Error
s associated with this exception