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

Unable to read key from file #95

Open
fd6130 opened this issue Jun 19, 2022 · 4 comments
Open

Unable to read key from file #95

fd6130 opened this issue Jun 19, 2022 · 4 comments

Comments

@fd6130
Copy link

fd6130 commented Jun 19, 2022

PHP 8.1
Symfony 6.1

I got a strange error when trying to access /token api

Unable to read key from file /var/oauth/private.key

I have both public and private key in /var/oauth, and yet it keep prompt unable to read key error.

@david-909
Copy link

Yeah I have the same issue. Tried putting the key in root, still nothing

@thejoelinux
Copy link

Can you try this :

  1. Put private.key and public.key in a config/jwt/ directory
  2. Reference them with the following instructions in league_oauth2_server.yaml file, under authorization_server and resource_server respectively.
private_key:          '%kernel.project_dir%/config/jwt/private.key'
public_key:           '%kernel.project_dir%/config/jwt/public.key'
  1. Check that the user running the web service, or php, has sufficient rights to read the private key, which is of course protected with a 600 mode.

@david-909
Copy link

@thejoelinux
Thank you man, it is working. I found a fix by putting the absolute path, but this is way better.

@chalasr
Copy link
Member

chalasr commented Sep 11, 2022

Sorry for not responding earlier, I totally missed this one. I'm going to have a look next week.

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

4 participants