Class JwtValidationException

    • Constructor Summary

      Constructors 
      Constructor 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:
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      java.util.Collection<OAuth2Error> getErrors()
      Return the list of OAuth2Errors associated with this exception
      • Methods inherited from class java.lang.Throwable

        addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
    • Constructor Detail

      • JwtValidationException

        public 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:
                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 Detail

      • getErrors

        public java.util.Collection<OAuth2Error> getErrors()
        Return the list of OAuth2Errors associated with this exception
        Returns:
        the list of OAuth2Errors associated with this exception