Repository navigation
[Identity] Fix TypeError from certain Entra responses - #44258
Merged
Merged
Conversation
Paul Van Eck (pvaneck)
force-pushed
the
identity-nonetype
branch
4 times, most recently
from
December 4, 2025 06:30
dcf6872 to
52470b0
Compare
Paul Van Eck (pvaneck)
marked this pull request as ready for review
December 4, 2025 23:37
Paul Van Eck (pvaneck)
requested a review
from Xiang Yan (xiangyan99)
as a code owner
December 4, 2025 23:37
Contributor
There was a problem hiding this comment.
Pull request overview
This PR fixes a TypeError that occurred when Microsoft Entra ID returned certain non-JSON responses (specifically None content). The fix adds defensive handling to catch this case early and raise a more helpful ClientAuthenticationError instead of allowing the code to fail with a TypeError when trying to call .get() on None.
Key Changes
- Added early validation in
_process_responseto check for None/empty content before attempting to use it - Added a test case to verify the fix handles None content properly
- Updated CHANGELOG.md to document the bug fix
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| sdk/identity/azure-identity/azure/identity/_internal/aad_client_base.py | Added if not content: check to raise ClientAuthenticationError early when response content is None or empty |
| sdk/identity/azure-identity/tests/test_aad_client.py | Added test_none_content_handling to verify None content is handled without TypeError |
| sdk/identity/azure-identity/CHANGELOG.md | Documented the bug fix with reference to PR #44258 |
Paul Van Eck (pvaneck)
force-pushed
the
identity-nonetype
branch
from
January 12, 2026 20:15
52470b0 to
755bb9d
Compare
Xiang Yan (xiangyan99)
approved these changes
Jan 13, 2026
Signed-off-by: Paul Van Eck <paulvaneck@microsoft.com>
Paul Van Eck (pvaneck)
force-pushed
the
identity-nonetype
branch
from
January 13, 2026 00:12
755bb9d to
11f52dc
Compare
Xiang Yan (xiangyan99)
approved these changes
Jan 13, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes: #44234