We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 1abfcac commit 08c3e00Copy full SHA for 08c3e00
1 file changed
O365/connection.py
@@ -880,11 +880,14 @@ def refresh_token(self) -> bool:
880
username=self.username, remove_reserved=True
881
)
882
883
- # call the refresh!
884
- result = self.msal_client.acquire_token_silent_with_error(
885
- scopes=scopes,
886
- account=self.msal_client.get_accounts(username=self.username)[0],
887
- )
+ if self.auth_flow_type == "credentials":
+ result = self.msal_client.acquire_token_for_client(scopes=scopes)
+ else:
+ # call the refresh!
+ result = self.msal_client.acquire_token_silent_with_error(
888
+ scopes=scopes,
889
+ account=self.msal_client.get_accounts(username=self.username)[0],
890
+ )
891
if result is None:
892
raise RuntimeError("There is no refresh token to refresh")
893
elif "error" in result:
0 commit comments