Class ErrorCodes

java.lang.Object
org.jose4j.jwt.consumer.ErrorCodes

public class ErrorCodes extends Object

Error codes, as int values, used by this library for programmatic access to (some) specific reasons for JWT invalidity by using InvalidJwtException.hasErrorCode(int).

New error code values may be added and used in future versions but only nonnegative values will be utilized. Thus custom ErrorCodeValidator implementations should use negative values for error codes so as to avoid potential collisions with error code values used by this library.

  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final int
    The Audience "aud" claim was invalid based on the audience that the JwtConsumer was set up to expect.
    static final int
    The JWT had no Audience "aud" claim but the JwtConsumer was set up to require it.
    static final int
    No JWE encryption was present but the JwtConsumer was set up to require it.
    static final int
    The JWT had no Expiration Time "exp" claim but the JwtConsumer was set up to require it.
    static final int
    The JWT had an Expiration Time "exp" claim with a value that was too far in the future based on the set up of the JwtConsumer.
    static final int
    The JWT expired (i.e.
    static final int
    The JwtConsumer was set up to require a JOSE algorithm that provides integrity protection (signature/MAC JWS or symmetric JWE) but no such protection was present on the JWT.
    static final int
    The value of the Issued At "iat" claim is too far in the future.
    static final int
    The value of the Issued At "iat" claim is too far in the past.
    static final int
    The JWT had no Issued At "iat" claim but the JwtConsumer was set up to require it.
    static final int
    The Issuer "iss" claim was invalid based on the issuer that the JwtConsumer was set up to expect.
    static final int
    The JWT had no Issuer "iss" claim but the JwtConsumer was set up to require it.
    static final int
    The JWS/JWE payload could not be parsed as JSON.
    static final int
    The JWT had no JWT ID "jti" claim but the JwtConsumer was set up to require it.
    static final int
    A JWT claim was of the wrong type or otherwise malformed.
    static final int
    Miscellaneous.
    static final int
    The JWT had no Not Before "nbf" claim but the JwtConsumer was set up to require it.
    static final int
    The Not Before "nbf" claim of the JWT indicates that it is not yet valid.
    static final int
    The JWS signature was not successfully verified with the given/resolved key.
    static final int
    No JWS signature was present but the JwtConsumer was set up to require one.
    static final int
    The Subject "sub" claim was invalid based on the subject that the JwtConsumer was set up to expect.
    static final int
    The JWT had no Subject "sub" claim but the JwtConsumer was set up to require it.
    static final int
    The type "typ" header value was invalid based on the type that the JwtConsumer was set up to expect.
    static final int
    No "typ" header parameter was present in the innermost JWS/JWE but the JwtConsumer was set up to require explicit typing.
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • EXPIRED

      public static final int EXPIRED
      The JWT expired (i.e. the Expiration Time "exp" claim identified a time in the past).
      See Also:
    • EXPIRATION_MISSING

      public static final int EXPIRATION_MISSING
      The JWT had no Expiration Time "exp" claim but the JwtConsumer was set up to require it.
      See Also:
    • ISSUED_AT_MISSING

      public static final int ISSUED_AT_MISSING
      The JWT had no Issued At "iat" claim but the JwtConsumer was set up to require it.
      See Also:
    • NOT_BEFORE_MISSING

      public static final int NOT_BEFORE_MISSING
      The JWT had no Not Before "nbf" claim but the JwtConsumer was set up to require it.
      See Also:
    • EXPIRATION_TOO_FAR_IN_FUTURE

      public static final int EXPIRATION_TOO_FAR_IN_FUTURE
      The JWT had an Expiration Time "exp" claim with a value that was too far in the future based on the set up of the JwtConsumer.
      See Also:
    • NOT_YET_VALID

      public static final int NOT_YET_VALID
      The Not Before "nbf" claim of the JWT indicates that it is not yet valid.
      See Also:
    • AUDIENCE_MISSING

      public static final int AUDIENCE_MISSING
      The JWT had no Audience "aud" claim but the JwtConsumer was set up to require it.
      See Also:
    • AUDIENCE_INVALID

      public static final int AUDIENCE_INVALID
      The Audience "aud" claim was invalid based on the audience that the JwtConsumer was set up to expect.
      See Also:
    • SIGNATURE_INVALID

      public static final int SIGNATURE_INVALID
      The JWS signature was not successfully verified with the given/resolved key.
      See Also:
    • SIGNATURE_MISSING

      public static final int SIGNATURE_MISSING
      No JWS signature was present but the JwtConsumer was set up to require one.
      See Also:
    • ISSUER_MISSING

      public static final int ISSUER_MISSING
      The JWT had no Issuer "iss" claim but the JwtConsumer was set up to require it.
      See Also:
    • ISSUER_INVALID

      public static final int ISSUER_INVALID
      The Issuer "iss" claim was invalid based on the issuer that the JwtConsumer was set up to expect.
      See Also:
    • JWT_ID_MISSING

      public static final int JWT_ID_MISSING
      The JWT had no JWT ID "jti" claim but the JwtConsumer was set up to require it.
      See Also:
    • SUBJECT_MISSING

      public static final int SUBJECT_MISSING
      The JWT had no Subject "sub" claim but the JwtConsumer was set up to require it.
      See Also:
    • SUBJECT_INVALID

      public static final int SUBJECT_INVALID
      The Subject "sub" claim was invalid based on the subject that the JwtConsumer was set up to expect.
      See Also:
    • JSON_INVALID

      public static final int JSON_INVALID
      The JWS/JWE payload could not be parsed as JSON.
      See Also:
    • MISCELLANEOUS

      public static final int MISCELLANEOUS
      Miscellaneous.
      See Also:
    • MALFORMED_CLAIM

      public static final int MALFORMED_CLAIM
      A JWT claim was of the wrong type or otherwise malformed.
      See Also:
    • ENCRYPTION_MISSING

      public static final int ENCRYPTION_MISSING
      No JWE encryption was present but the JwtConsumer was set up to require it.
      See Also:
    • INTEGRITY_MISSING

      public static final int INTEGRITY_MISSING
      The JwtConsumer was set up to require a JOSE algorithm that provides integrity protection (signature/MAC JWS or symmetric JWE) but no such protection was present on the JWT.
      See Also:
    • TYPE_MISSING

      public static final int TYPE_MISSING
      No "typ" header parameter was present in the innermost JWS/JWE but the JwtConsumer was set up to require explicit typing.
      See Also:
    • TYPE_INVALID

      public static final int TYPE_INVALID
      The type "typ" header value was invalid based on the type that the JwtConsumer was set up to expect.
      See Also:
    • ISSUED_AT_INVALID_FUTURE

      public static final int ISSUED_AT_INVALID_FUTURE
      The value of the Issued At "iat" claim is too far in the future.
      See Also:
    • ISSUED_AT_INVALID_PAST

      public static final int ISSUED_AT_INVALID_PAST
      The value of the Issued At "iat" claim is too far in the past.
      See Also:
  • Constructor Details

    • ErrorCodes

      public ErrorCodes()