Skip to content

Commit

Permalink
Tiny cleanup for signoff message.
Browse files Browse the repository at this point in the history
Signed-off-by: Reigo Reinmets <[email protected]>
  • Loading branch information
xataxxx committed Jul 18, 2024
1 parent 9661611 commit 876b50d
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions lib/Controller/LoginController.php
Original file line number Diff line number Diff line change
Expand Up @@ -415,7 +415,7 @@ public function code(string $state = '', string $code = '', string $scope = '',

$headers = [];
$tokenEndpointAuthMethod = 'client_secret_basic';
// Use POST only if client_secret_basic is not available
// Use POST only if client_secret_basic is not available as supported by the endpoint
if (array_key_exists('token_endpoint_auth_methods_supported', $discovery) &&
is_array($discovery['token_endpoint_auth_methods_supported']) &&
in_array('client_secret_post', $discovery['token_endpoint_auth_methods_supported']) &&
Expand All @@ -424,9 +424,8 @@ public function code(string $state = '', string $code = '', string $scope = '',
}

if ($tokenEndpointAuthMethod == 'client_secret_basic') {
$credentials = base64_encode($provider->getClientId() . ':' . $providerClientSecret);
$headers = [
'Authorization' => 'Basic ' . $credentials,
'Authorization' => 'Basic ' . base64_encode($provider->getClientId() . ':' . $providerClientSecret),
'Content-Type' => 'application/x-www-form-urlencoded',
];
} else {
Expand Down

0 comments on commit 876b50d

Please sign in to comment.