7

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:

  • Windows 10 64bit
  • WampServer 3.1.0
  • Apache 2.4.27
  • PHP 7.0.23
  • Laravel Framework version 5.3.31
  • composer require laravel/passport=~1.0

Any idea how to solve it?

FULL STACK DEV
  • 15,207
  • 5
  • 46
  • 66
zarpio
  • 10,380
  • 8
  • 58
  • 71

2 Answers2

12

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.

FULL STACK DEV
  • 15,207
  • 5
  • 46
  • 66
2

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.

Justin
  • 901
  • 8
  • 11