Private.key does not exist or is not readable

Hello Everyone,

I am working with custom rest API. I just followed the instruction JSON API Guide here

At first it works but generate new private and public key. I deleted the existing keys and generate new one. Then I got this error below:

[18-Oct-2022 08:47:25 UTC] PHP Fatal error:  Uncaught LogicException: Key path "file:///vagrant/myinstall/Api/V8/OAuth2/private.key" does not exist or is not readable in /vagrant/myinstall/vendor/league/oauth2-server/src/CryptKey.php:45
Stack trace:
#0 /vagrant/myinstall/Api/V8/Config/services/middlewares.php(40): League\OAuth2\Server\CryptKey->__construct()
#1 /vagrant/myinstall/vendor/pimple/pimple/src/Pimple/Container.php(122): Api\Core\Resolver\ConfigResolver::{closure}()
#2 /vagrant/myinstall/vendor/slim/slim/Slim/Container.php(109): Pimple\Container->offsetGet()
#3 /vagrant/myinstall/Api/V8/Config/routes.php(17): Slim\Container->get()
#4 /vagrant/myinstall/vendor/slim/slim/Slim/RouteGroup.php(25): Api\Core\Loader\RouteLoader->{closure}()
#5 /vagrant/myinstall/vendor/slim/slim/Slim/App.php(272): Slim\RouteGroup->__invoke()
#6 /vagrant/myinstall/Api/V8/Config/routes.php(132): Slim\App->group()
#7 /vagrant/myinstall/Api/Core/Loader/RouteLoader.php(21): require('/vagrant/myinst...')
#8 /vagrant/myinstall/Api/Core/app.php(26): Api\Core\Loader\RouteLoad in /vagrant/myinstall/vendor/league/oauth2-server/src/CryptKey.php on line 45

Nevermind I was able to fix it I use 660 instead of 600.

used this one

sudo chmod 660 private.key public.key

instead of this:

sudo chmod 600 private.key public.key

But why I got this error on api/access_token?

access_token is a POST call not a GET call

Its working now, but I got an error

heres my OAuth config:

Nevermind its working now.

Don`t forget to add your secret key at Change Secret: i.e 123456