From 67763c654d968b6a59f81c4a59a8a5bfe863f75b Mon Sep 17 00:00:00 2001 From: Yuto Moriyasu Date: Mon, 6 Feb 2023 19:05:43 +0900 Subject: [PATCH] fix getAuthCredentials params --- README.md | 2 +- src/Laravel/Controllers/CallbackApiController.php | 2 +- src/Laravel/Controllers/CallbackController.php | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index b27b199..22edcd2 100644 --- a/README.md +++ b/README.md @@ -23,7 +23,7 @@ composer require saasus-platform/saasus-sdk-php SAASUS_SAAS_ID="(画面のSaaS ID)" SAASUS_API_KEY="(画面のAPI KEY)" SAASUS_SECRET_KEY="(画面のクライアントシークレット)" -SAASUS_LOGIN_URL="https://auth.sample.saasus.jp/ (ログイン画面のURL)" +SAASUS_LOGIN_URL="https://auth.sample.saasus.jp/(ログイン画面のURL)" ``` SAASUS_SAAS_ID, SAASUS_API_KEY, SAASUS_SECRET_KEY は SaaS 開発コンソール画面に表示されている SaaS ID、 API キー  と クライアントシークレットを、 diff --git a/src/Laravel/Controllers/CallbackApiController.php b/src/Laravel/Controllers/CallbackApiController.php index 43dc2f6..06fdf65 100644 --- a/src/Laravel/Controllers/CallbackApiController.php +++ b/src/Laravel/Controllers/CallbackApiController.php @@ -27,7 +27,7 @@ public function index(Request $request) $client = new ApiClient(); $authApi = $client->getAuthClient(); try { - $res = $authApi->getAuthCredentials(['code' => $request->code], $authApi::FETCH_RESPONSE); + $res = $authApi->getAuthCredentials(['auth-flow' => 'tempCodeAuth', 'code' => $request->code], $authApi::FETCH_RESPONSE); return json_decode($res->getBody(), true); } catch (GetAuthCredentialsNotFoundException | GetAuthCredentialsInternalServerErrorException $e) { if (get_class($e) == 'GetAuthCredentialsNotFoundException') { diff --git a/src/Laravel/Controllers/CallbackController.php b/src/Laravel/Controllers/CallbackController.php index ddfea31..f761bc7 100644 --- a/src/Laravel/Controllers/CallbackController.php +++ b/src/Laravel/Controllers/CallbackController.php @@ -26,7 +26,7 @@ public function index(Request $request) $client = new ApiClient; $authApiClient = $client->getAuthClient(); try { - $res = $authApiClient->getAuthCredentials(['code' => $request->code]); + $res = $authApiClient->getAuthCredentials(['auth-flow' => 'tempCodeAuth', 'code' => $request->code]); $idToken = $res->getIdToken(); } catch (GetAuthCredentialsNotFoundException | GetAuthCredentialsInternalServerErrorException $e) { if (get_class($e) == 'GetAuthCredentialsNotFoundException') {