-
Notifications
You must be signed in to change notification settings - Fork 3.3k
Closed
Description
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):
azure-cli/src/azure-cli-core/azure/cli/core/adal_authentication.py
Lines 61 to 67 in c2b9a2c
| # 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'])) |