Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve Error Message When Incorrect Passphrase is Provided for Private Key #1262

Open
amarc-sudo opened this issue Dec 6, 2024 · 0 comments

Comments

@amarc-sudo
Copy link

Hello,

First of all, thank you for this bundle and for maintaining it over the years—it’s been a great help!

I’ve encountered an issue where, if the environment variable contains an incorrect passphrase for decrypting the private key used to sign JWTs, no explicit error is thrown. Instead, it only notifies us that the JWT cannot be signed.

Here is the error message:

Uncaught PHP Exception Lexik\Bundle\JWTAuthenticationBundle\Exception\JWTEncodeFailureException: "Unable to create a signed JWT from the given configuration." at /usr/local/var/www/html/vendor/lexik/jwt-authentication-bundle/Encoder/LcobucciJWTEncoder.php line 38

Steps to Reproduce

  1. Generate keys with a passphrase.
  2. Store an incorrect passphrase in the environment variable.
  3. Attempt to sign a JWT.

The error message could be improved to explicitly indicate that the passphrase is incorrect, making it easier to debug such cases.

Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant