Open sidebar
/* cabinet */ Route::get('cabinet', function () { $query = http_build_query([ 'response_type' => 'code', 'client_id' => config("app.oauth_client_id"), 'redirect_uri' => config("app.url")."/cabinet/callback", 'scope' => '', ]); return redirect (config("app.oauth_url")."oauth/authorize?".$query); }); Route::get('/cabinet/callback', function (Request $request){ $client = new GuzzleHttp\Client; $response = $client->post(config("app.oauth_url")."oauth/token",[ 'form_params' => [ 'grant_type' => 'authorization_code', 'client_id' => config("app.oauth_client_id") , 'client_secret' => config("app.oauth_client_password") , 'redirect_uri' => config("app.url")."/cabinet/callback", 'code' => \Illuminate\Support\Facades\Input::get("code"), ], ]); return json_decode((string) $response->getBody(), true); });
Close sidebar
Back
Please note that all pasted data is publicly available.
Twitter
GitHub
Use setting
Back
Please note that all pasted data is publicly available.
Twitter
GitHub
Use setting