网站无法验证用户

时间:2018-11-22 19:49:50

标签: laravel login oauth vagrant homestead

我似乎无法弄清楚,我也是Laravel新手-所以也许找错地方了。我已经通过回购在计算机上设置了一个新站点,并且所有内容都能正确编译,但是我无法解决OAuth错误。该站点是一个用户仪表板,我需要能够登录才能看到其他页面。

当我打开站点时,在控制台中看到以下错误:

Uncaught (in promise) Failed to re-authenticate user

当我尝试使用自己的凭据登录时,我看到:

VM38:1 POST http://127.0.0.1:8000/oauth/token 500 (Internal Server Error)

我查看了Laravel日志,并看到以下消息:

local.ERROR: Key path "file:///home/vagrant/code/storage/oauth-private.key" does not exist or is not readable {"exception":"[object] (LogicException(code: 0): Key path \"file:///home/vagrant/code/storage/oauth-private.key\" does not exist or is not readable at /home/vagrant/code/vendor/league/oauth2-server/src/CryptKey.php:45)

最初设置站点时,我成功运行了:

composer install
php artisan migrate

并使用artisan passport:client --password生成了一个新的OAuth密钥。

无法弄清楚如何解决令牌错误。

1 个答案:

答案 0 :(得分:0)

您需要运行php artisan passport:install来生成密钥文件。

相关问题