尝试使用POSTMAN注册用户时Laravel 5.6.26护照入口错误

时间:2018-06-28 09:28:49

标签: guzzle laravel-5.6 laravel-passport

我正在尝试实施Laravel Passport。尝试注册用户但不找回令牌时:

public function register(Request $request)
{
    $guzzle = new Client;
    $response = $guzzle->post(
        url('oauth/token'),
        ['form_params' => [
                'grant_type' => 'password',
                'client_id' => '2',
                'client_secret' => 'Px6fw3lwWy81Gwudx5eUa5xKHFG2jUDnNQ9qSPP5',
                'email' => $request->email,
                'password' => $request->password,
                'scope' => '',
            ],]);
    return response(['auth' => json_decode((string)$response->getBody(), true), 'user' => $user]);

我正在使用邮递员: 在我设置的标题中:接受:application / json 体内:

email:test@test.test
password:password
name:test

我在这里缺少什么参数?在哪里找到它?在我的拉瓦雷尔日志中,我只看到错误:

 "message": "Client error: `POST http://homestead.test/oauth/token` resulted in a `401 Unauthorized` response:\n{\"error\":\"invalid_client\",\"message\":\"Client authentication failed\"}\n",
"exception": "GuzzleHttp\\Exception\\ClientException",
"file": "/home/vagrant/code/vendor/guzzlehttp/guzzle/src/Exception/RequestException.php",
"line": 113,....

那我缺少哪个参数?

0 个答案:

没有答案