Skip to content

{Core} AdalAuthentication doesn't honor scopes for Track 2 SDK #15179

@jiasli

Description

@jiasli

Describe the bug

In Track 2 SDK, scopes (resource) is managed by SDK, instead of Azure CLI. For example, in AzureAppConfigurationClient:

if aad_mode:
    scope = base_url.strip("/") + "/.default"

But in get_token, scopes is not honored (discarded), resulting in getting a token for a wrong scopes (ARM https://management.core.windows.net/ by default):

# This method is exposed for Azure Core.
def get_token(self, *scopes, **kwargs): # pylint:disable=unused-argument
_, token, full_token, _ = self._get_token()
try:
return AccessToken(token, int(full_token['expiresIn'] + time.time()))
except KeyError: # needed to deal with differing unserialized MSI token payload
return AccessToken(token, int(full_token['expires_on']))

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions