password 密码授权 401 错误
Client error: POST http://lab57.test/oauth/token
resulted in a 401 Unauthorized
response: {"error":"invalid_client","message":"Client authentication failed"}
下面是我写的代码:我确定client_id 和 secret 没有问题 就是不知道 这个username和password到底是啥 有哪位同学能告诉我 不剩感谢 已经折腾我一晚上 依旧不能解决问题 我无论是用户表users 的用户名密码 还是邮件 密码 还是
oauth_clients 的name 和 password_client 都试过 y依旧报401错误
Route::get('speakr/password-grant-auth',function (){
$http = new GuzzleHttp\Client;
$response = $http->post('http://lab57.test/oauth/token', [
'form_params' => [
'grant_type' => 'password',
'client_id' => '1',
'client_secret' => '087OhJ2qwWxUe1xSBa2RfSODBiYYIxtWeEVXdOf1',
'username' => 'fc3',
'password' => 1,
'scope' => '*',
],
]);
return json_decode((string) $response->getBody(), true);
});
推荐文章: