Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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