From 4a7d36a135662f11bfa0284a109064e4b1d47ded Mon Sep 17 00:00:00 2001 From: Ray Luo Date: Wed, 17 Jan 2024 22:08:53 -0800 Subject: [PATCH] Attempts account removal from broker first --- msal/application.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/msal/application.py b/msal/application.py index afa08f5a..96277e4a 100644 --- a/msal/application.py +++ b/msal/application.py @@ -1123,12 +1123,13 @@ def _get_authority_aliases(self, instance): def remove_account(self, account): """Sign me out and forget me from token cache""" - self._forget_me(account) if self._enable_broker: from .broker import _signout_silently error = _signout_silently(self.client_id, account["local_account_id"]) if error: logger.debug("_signout_silently() returns error: %s", error) + # Broker sign-out has been attempted, even if the _forget_me() below throws. + self._forget_me(account) def _sign_out(self, home_account): # Remove all relevant RTs and ATs from token cache