Skip to content

Commit 2a3e1c4

Browse files
authored
Merge pull request #140 from AzureAD/error_description-is-optional
error_description is optional
2 parents ab48adf + fe0f957 commit 2a3e1c4

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

msal/application.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -576,8 +576,10 @@ def _acquire_token_silent_by_finding_specific_refresh_token(
576576
**kwargs)
577577
if "error" not in response:
578578
return response
579-
logger.debug(
580-
"Refresh failed. {error}: {error_description}".format(**response))
579+
logger.debug("Refresh failed. {error}: {error_description}".format(
580+
error=response.get("error"),
581+
error_description=response.get("error_description"),
582+
))
581583
if break_condition(response):
582584
break
583585

tests/test_application.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ def test_unknown_orphan_app_will_attempt_frt_and_not_remove_it(self):
7474
logger.debug("%s.cache = %s", self.id(), self.cache.serialize())
7575
def tester(url, data=None, **kwargs):
7676
self.assertEqual(self.frt, data.get("refresh_token"), "Should attempt the FRT")
77-
return Mock(status_code=200, json=Mock(return_value={
77+
return Mock(status_code=400, json=Mock(return_value={
7878
"error": "invalid_grant",
7979
"error_description": "Was issued to another client"}))
8080
app._acquire_token_silent_by_finding_rt_belongs_to_me_or_my_family(

0 commit comments

Comments
 (0)