Skip to content

Split jwt_token_invalid error type: separate error type for semantic token errors #795

@johakoch

Description

@johakoch

Currently, there are three specific jwt error types:

  • jwt_token_missing for a missing token,
  • jwt_token_expired for an expired token,
  • jwt_token_invalid for an invalid token (token syntactically not a JWT, or not sufficient, e.g. because required claims are missing or have unexpected values).

As the jwt_token_invalid currently covers both syntactic and semantic invalidity, it's impossible to do separate error handling for semantic errors (like missing claims or unexpected claim values) on the one hand, and syntactic errors (like broken tokens, invalid signature) on the other.

The new error type should cover the following cases:

  • missing claim (as per required_claims attribute)
  • unexpected claim values (as per claims attribute); this also applies to issuer and audience verification.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions