0
laravelを使用してサーバーとクライアントの両方のアプリケーションを作成すると、サーバーアプリケーションからクライアントアプリケーションにもデータにアクセスできます。しかし今、私はcodeigniterを使って別のクライアントアプリケーションを作りたいと思っています。認可は、コールバックメソッドを除いて機能します。どうすればこのコードを変換できますか?Laravelパスポート「トークンにアクセスするための認証コードの変換」codeigniterのコード
Route::get('/callback', function (Request $request) {
$http = new GuzzleHttp\Client;
$response = $http->post('http://your-app.com/oauth/token', [
'form_params' => [
'grant_type' => 'authorization_code',
'client_id' => 'client-id',
'client_secret' => 'client-secret',
'redirect_uri' => 'http://example.com/callback',
'code' => $request->code,
],
]);
return json_decode((string) $response->getBody(), true);
});
into CodeIgniter 2?
ありがとうございました