Skip to content

Distinguish errors from secret or public key callback #746

Open

Description

@borfig

Please do not report security vulnerabilities here. The Responsible Disclosure Program details the procedure for disclosing security issues.

Thank you in advance for helping us to improve this library! Your attention to detail here is greatly appreciated and will help us respond as quickly as possible. For general support or usage questions, use the Auth0 Community or Auth0 Support. Finally, to avoid duplicates, please search existing Issues before submitting one here.

By submitting an Issue to this repository, you agree to the terms within the Auth0 Code of Conduct.

Describe the problem you'd like to have solved

It is not possible to properly distinguish errors from secret or public key callback from other errors in verify.
The error from the secret or public key callback is a generic JsonWebTokenError.

return done(new JsonWebTokenError('error in secret or public key callback: ' + err.message));

Describe the ideal solution

  1. Provide a separate error sub-class for those errors;
  2. Put the callback error as the inner error of the wrapping error

Alternatives and current work-arounds

Parsing the error message of the error returned by verify.

Additional context

The caller of verify may act differently if it encounters this type of errors.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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