Skip to content

Commit

Permalink
Revert "msal-data"
Browse files Browse the repository at this point in the history
This reverts commit b5bb413.
  • Loading branch information
jiasli committed Oct 12, 2024
1 parent b5bb413 commit cd9c915
Showing 1 changed file with 4 additions and 13 deletions.
17 changes: 4 additions & 13 deletions src/azure-cli-core/azure/cli/core/auth/msal_credentials.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,13 +57,8 @@ def get_token(self, *scopes, claims=None, **kwargs):
if claims:
logger.warning('Acquiring new access token silently for tenant %s with claims challenge: %s',
self._msal_app.authority.tenant, claims)

msal_kwargs = {}
if 'data' in kwargs:
msal_kwargs['data'] = kwargs['data']

result = self._msal_app.acquire_token_silent_with_error(
list(scopes), self._account, claims_challenge=claims, **msal_kwargs)
result = self._msal_app.acquire_token_silent_with_error(list(scopes), self._account, claims_challenge=claims,
**kwargs)

from azure.cli.core.azclierror import AuthenticationError
try:
Expand All @@ -87,7 +82,7 @@ def get_token(self, *scopes, claims=None, **kwargs):
result = self._msal_app.acquire_token_interactive(
list(scopes), login_hint=self._account['username'],
port=8400 if self._msal_app.authority.is_adfs else None,
success_template=success_template, error_template=error_template, **msal_kwargs)
success_template=success_template, error_template=error_template, **kwargs)
check_result(result)

# For other scenarios like Storage Conditional Access MFA step-up, do not
Expand All @@ -110,10 +105,6 @@ def __init__(self, client_id, client_credential, **kwargs):
def get_token(self, *scopes, **kwargs):
logger.debug("ServicePrincipalCredential.get_token: scopes=%r, kwargs=%r", scopes, kwargs)

msal_kwargs = {}
if 'data' in kwargs:
msal_kwargs['data'] = kwargs['data']

result = self._msal_app.acquire_token_for_client(list(scopes), **msal_kwargs)
result = self._msal_app.acquire_token_for_client(list(scopes), **kwargs)
check_result(result)
return build_sdk_access_token(result)

0 comments on commit cd9c915

Please sign in to comment.