Skip to content

Commit

Permalink
fix(#392): avoid to send optional empty scope in a client credentials…
Browse files Browse the repository at this point in the history
… grant
  • Loading branch information
DominicDetta committed Oct 10, 2023
1 parent 5d69bcf commit fea9484
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/OpenIDConnectClient.php
Original file line number Diff line number Diff line change
Expand Up @@ -810,9 +810,12 @@ public function requestClientCredentialsToken() {
$post_data = [
'grant_type' => $grant_type,
'client_id' => $this->clientID,
'client_secret' => $this->clientSecret,
'scope' => implode(' ', $this->scopes)
'client_secret' => $this->clientSecret
];

if ($this->scopes) {
$post_data['scope'] = implode(' ', $this->scopes);
}

// Convert token params to string format
$post_params = http_build_query($post_data, '', '&', $this->encType);
Expand Down

0 comments on commit fea9484

Please sign in to comment.