Skip to content

Commit 107f54f

Browse files
committed
Update authentication handling to use Request\Body::form for grant_type in BaseController
1 parent ad2c358 commit 107f54f

2 files changed

Lines changed: 3 additions & 1 deletion

File tree

.github/workflows/test.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,8 @@ jobs:
3535
BW_ACCOUNT_ID: ${{ secrets.BW_ACCOUNT_ID }}
3636
BW_USERNAME: ${{ secrets.BW_USERNAME }}
3737
BW_PASSWORD: ${{ secrets.BW_PASSWORD }}
38+
BW_CLIENT_ID: ${{ secrets.BW_CLIENT_ID }}
39+
BW_CLIENT_SECRET: ${{ secrets.BW_CLIENT_SECRET }}
3840
BW_VOICE_APPLICATION_ID: ${{ secrets.BW_VOICE_APPLICATION_ID }}
3941
BW_MESSAGING_APPLICATION_ID: ${{ secrets.BW_MESSAGING_APPLICATION_ID }}
4042
BW_NUMBER: ${{ secrets.BW_NUMBER }}

src/Controllers/BaseController.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,7 @@ protected function configureOAuth2Auth(&$headers)
132132
$this->config->getClientId() . ':' . $this->config->getClientSecret()
133133
),
134134
],
135-
'grant_type=client_credentials'
135+
\Unirest\Request\Body::Form(['grant_type' => 'client_credentials'])
136136
);
137137

138138
if ($response->code < 200 || $response->code > 299 || !isset($response->body->access_token)) {

0 commit comments

Comments
 (0)