我需要在内腔中获取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';
});
我无法获得新的访问令牌
再次感谢...