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

Using a string instead of a file path for the private property in jwt.php. #2240

Open
peacefixation opened this issue Feb 14, 2024 · 0 comments

Comments

@peacefixation
Copy link

Subject of the issue

Using a string instead of a file path for the private property in jwt.php.

Your environment

Q A
Bug? no
New Feature? yes
Framework Laravel
Framework version 9.52.15
Package version 2.0
PHP version 8.1.7

Steps to reproduce

I've just updated tymon/jwt-auth from 1.0 to 2.0 and the previous code stopped working. In jwt.php I was setting 'private' => env('JWT_PRIVATE_KEY') where JWT_PRIVATE_KEY='-----BEGIN RSA PRIVATE KEY----- etc' (i.e. a string with the contents of a .pem file).

I can get it working again by putting the contents into an actual jwt-private-key.pem file and setting my environment variable to the file path JWT_PRIVATE_KEY='file://jwt-private-key.pem' but I would prefer not to do this and use a string instead so I can set it in a secrets manager for CI and deployment environments.

Forgive me if this is an easy or stupid problem, I'm not a PHP programmer, I'm just flailing around trying to update a Laravel project to v9 and then v10.

Expected behaviour

I can set 'private' => 'a string with the contents of the jwt-private-key.pem'

Actual behaviour

I have to set 'private' => 'file://jwt-private-key.pem'

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