Skip to content

Commit

Permalink
check content (Azure#23496)
Browse files Browse the repository at this point in the history
  • Loading branch information
xiangyan99 authored and rakshith91 committed Apr 7, 2022
1 parent bbf1160 commit 489d667
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
2 changes: 2 additions & 0 deletions sdk/identity/azure-identity/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@

### Bugs Fixed

- Added check on `content` from msal response ([#23483](https://github.com/Azure/azure-sdk-for-python/issues/23483))

### Other Changes

## 1.9.0b1 (2022-03-08)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,9 @@ def raise_for_status(self):

if ContentDecodePolicy.CONTEXT_NAME in self._response.context:
content = self._response.context[ContentDecodePolicy.CONTEXT_NAME]
if "error" in content or "error_description" in content:
if not content:
message = "Unexpected response from Azure Active Directory"
elif "error" in content or "error_description" in content:
message = "Authentication failed: {}".format(content.get("error_description") or content.get("error"))
else:
for secret in ("access_token", "refresh_token"):
Expand Down

0 comments on commit 489d667

Please sign in to comment.