Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -135,8 +135,6 @@ def get_token(self, *scopes, **kwargs):
logger.debug("ServicePrincipalCredential.get_token: scopes=%r, kwargs=%r", scopes, kwargs)

scopes = list(scopes)
result = self.acquire_token_silent(scopes, None, **kwargs)
if not result:
result = self.acquire_token_for_client(scopes, **kwargs)
result = self.acquire_token_for_client(scopes, **kwargs)
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This change is purely for code cleanliness.

MSAL 1.24.0b1 installed by #26980 will also include this functionality, as calling acquire_token_silent with account=None is now a no-op:

https://github.com/AzureAD/microsoft-authentication-library-for-python/blob/95df6086ec186e395186e097f8c9103c4ee74d83/msal/application.py#L1272-L1273

        if not account:
            return None  # A backward-compatible NO-OP to drop the account=None usage

check_result(result)
return build_sdk_access_token(result)