From e4b064bb6ccb5ebd06b246acd06c097280c7b94e Mon Sep 17 00:00:00 2001 From: pstruebi Date: Mon, 24 Jun 2024 22:00:47 +0200 Subject: [PATCH] Revert account selecton --- propedal-planner/calendar_interface.py | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/propedal-planner/calendar_interface.py b/propedal-planner/calendar_interface.py index 8353ff7..f3ffc0e 100644 --- a/propedal-planner/calendar_interface.py +++ b/propedal-planner/calendar_interface.py @@ -30,17 +30,15 @@ app = msal.ConfidentialClientApplication( # You can learn how to use SerializableTokenCache from # https:#msal-python.readthedocs.io/en/latest/#msal.SerializableTokenCache ) -accounts = app.get_accounts(username=None) - def get_access_token(): - global app, token, accounts + global app, token # The pattern to acquire a token looks like this. # Firstly, looks up a token from cache # Since we are looking for token for the current app, NOT for an end user, # notice we give account parameter as None. - token = app.acquire_token_silent(MsalConfig.SCOPE, account=accounts[0]) + token = app.acquire_token_silent(MsalConfig.SCOPE, account=None) if token is None: logging.info("No suitable token exists in cache. Let's get a new one from AAD.")