View Javadoc

1   package com.atlassian.asap.api.exception;
2   
3   /**
4    * Indicates a JWT was syntactically well formed (parses successfully), but failed to validate.
5    */
6   public abstract class InvalidTokenException extends Exception {
7       protected InvalidTokenException(String message) {
8           super(message);
9       }
10  
11      protected InvalidTokenException(String message, Throwable cause) {
12          super(message, cause);
13      }
14  
15      protected InvalidTokenException(Throwable cause) {
16          super(cause);
17      }
18  
19      /**
20       * Returns safe-to-propagate details about this exception, eg. the class name (eg. TokenTooEarlyException,
21       * MissingRequiredClaimException, etc.), that we can safely include in any information sent back to the caller
22       * (eg. exception messages).  May be extended by descendants to provide additional safe-to-propagate details,
23       * where appropriate for more specialised exceptions.
24       *
25       * @return a string which contains basic details about this exception, and is safe to propagate and log
26       */
27      public String getSafeDetails() {
28          return getClass().getSimpleName();
29      }
30  }