【发布时间】:2016-02-10 06:55:01
【问题描述】:
我正在使用OAuth-Server-Laravel repo docs,我正在使用 Lumen。我已经成功地将客户端凭据授予类型设置为工作,并尝试将其移至密码授予类型。
我添加了带有verify() 函数的PasswordVerifier 类,将我的数据库oauth_clients 表更改为:
$table->string('id', 40)->primary();
$table->string('username');
$table->string('password');
$table->string('email');
$table->timestamps();
$table->unique(['id', 'username']);
和verify() 的作用是:
'username' => $username,
'password' => $password,
当我在 Postman 中尝试时,我收到:
"The request is missing a required parameter, includes an invalid parameter value, includes a parameter more than once, or is otherwise malformed. Check the \"client_id\" parameter."
然后我阅读了问题,发现我需要在username 和password 凭据旁边导入client_id 和client_secret。我知道这些是我应该定义的。
但是,我不知道在哪里放置、存储和调用它们?我应该将它们存储在.env 文件中吗?如果是这样,我应该如何在验证函数中调用它?
【问题讨论】:
标签: php laravel oauth oauth-2.0 lumen