az login ignores scope parameter when it's set to https://vault.azure.net/.default #29968
Labels
Account
az login/account
ARM
az resource/group/lock/tag/deployment/policy/managementapp/account management-group
Auto-Assign
Auto assign by bot
Azure CLI Team
The command of the issue is owned by Azure CLI team
customer-reported
Issues that are reported by GitHub users external to the Azure organization.
question
The issue doesn't require a change to the product in order to be resolved. Most issues start as that
Similar-Issue
Milestone
Describe the bug
> az login --scope https://vault.azure.net/.default
(pops up login dialog, I do the login, login succeeds)
> az account get-access-token
and pasting the output
accessToken
into https://jwt.ms yields"aud": "https://management.core.windows.net/"
when it should be
https://vault.azure.net
.Thus when I try to use that access token to sign a payload using a key in a Key Vault that my user has access to, I get:
AKV10022: Invalid audience. Expected <guid>, found: https://management.core.windows.net/.
Related command
az login
Errors
As above.
Issue script & Debug output
If I run
az login --scope https://vault.azure.net/.default --debug
I see the following output:shortly followed by
Note the
scope
in both instances - initially it's Key Vault as expected, but later on it is incorrectly set (overwritten?) tohttps://management.core.windows.net/
.Expected behavior
I am logged into Key Vault and can retrieve an access token to perform operations against it.
Environment Summary
Additional context
No response
The text was updated successfully, but these errors were encountered: