流明oauth 2生成新的访问令牌

时间:2018-03-15 07:46:05

标签: laravel laravel-5 oauth oauth-2.0

我需要在内腔中获取OAuth 2.0新访问令牌。

我的路线

Route::get('callback', function () {
    $http = new GuzzleHttp\Client;

    $response = $http->get('http://localhost/Yuvaraj/lumen/public/token', [
        'form_params' => [
            'grant_type' => 'client_secret',
            'client_id' => 2,
            'client_secret' => 'hDT0Sym8rfxtgt577QBvgkOtDZd7SLfoik93nkmk',
            'redirect_uri' => 'http://localhost/Yuvaraj/lumen/public/callback',
            'scope' => ''
        ],
    ]);
    echo "<pre>";print_r($response);echo "</pre>";
    return json_decode((string) $response->getBody()->getContents(), true);
});

Route::get('token', function(){
    return 'Hello world';
});

我无法获得新的访问令牌

再次感谢...

0 个答案:

没有答案