ErrorException in CryptKey.php line 57:
Key file "file://C:\wamp\www\project\public_html\storage\oauth-private.key" permissions are not correct, should be 600 or 660 instead of 666
My Configuration as follows:
Any idea how to solve it?
Laravel Passport is an OAuth 2.0 server implementation for API authentication using Laravel. Since tokens are generally used in API authentication, Laravel Passport provides an easy and secure way to implement token authorization on an OAuth 2.0 server.
Requesting Tokens Once you have created a password grant client, you may request an access token by issuing a POST request to the /oauth/token route with the user's email address and password. Remember, this route is already registered by the Passport::routes method so there is no need to define it manually.
Check your database. There must be tables about laravel passport. You should post the datas below to '/user' url. You must edit grant_type, client_id and client_secret keys according to values in the oauth_clients table in your database.
You can turn off file checking permissions on line 57
your CryptKey Path is vendor/league/oauth2-server/src/CryptKey.php
on line number 48 turn it to false or comment the following block in your CryptKey.php
if ($keyPermissionsCheck === true) {
// Verify the permissions of the key
$keyPathPerms = decoct(fileperms($keyPath) & 0777);
if (in_array($keyPathPerms, ['600', '660'], true) === false) {
trigger_error(sprintf(
'Key file "%s" permissions are not correct, should be 600 or 660 instead of %s',
$keyPath,
$keyPathPerms
), E_USER_NOTICE);
}
}
keyPermissionsCheck
set it to false.
Hope this helps.
Simply CHMOD the oauth-private.key file to 600 or 660. I see that you use Windows so you can surely follow the directions in this post to do that.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With