Skip to content

Mandatory JWT Key Length Assertions #334

@lhazlewood

Description

@lhazlewood

Too many submitted issues are submitted like "My key on service A works, but it's not working with JJWT". This is basically because:

  1. The user uses a String key that is not Base64-encoded as the JJWT signWith JavaDoc clearly documents, or:
  2. The key is rarely of the mandatory length required by the JWT specification.

This issue represents the work to throw an exception if invalid keys are used to sign or verify a JWT, namely when using the setSigningKey or signWith methods.

The JWT RFC REQUIRES that key lengths meet guaranteed minimums depending on the algorithm strength chosen, and too many people don't do this. Because JJWT is a spec-compliant library, it must enforce Specification-mandated behavior.

See https://stackoverflow.com/a/40274325/407170 for more information.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions