public static Throwable unwrap(Throwable e) {
    Throwable cause = e;
    while (cause != null) {
      if (cause instanceof InvalidToken) {
        return cause;
      }
      cause = cause.getCause();
    }
    return e;
  }
Unwrap InvalidToken exception, otherwise return the one passed in.
hbase-server/src/main/java/org/apache/hadoop/hbase/security/HBaseSaslRpcServer.java