Skip to content

Commit

Permalink
Fix error detection
Browse files Browse the repository at this point in the history
The previous error detection code seems to have been copied from stevenmaguire/oauth2-microsoft, but the response format for errors seem to be different when using Azure. 
Part of an example JSON:
{
    "error": "invalid_client",
    "error_description": "[…]",
…
  • Loading branch information
lukasmerk authored Dec 12, 2023
1 parent 8eaaaf5 commit 8bb1c6d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/Provider/Azure.php
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ protected function checkResponse(ResponseInterface $response, $data)
{
if (isset($data['error'])) {
throw new IdentityProviderException(
(isset($data['error']['message']) ? $data['error']['message'] : $response->getReasonPhrase()),
(isset($data['error_description']) ? $data['error_description'] : $response->getReasonPhrase()),
$response->getStatusCode(),
(string)$response->getBody()
);
Expand Down

0 comments on commit 8bb1c6d

Please sign in to comment.