-
Notifications
You must be signed in to change notification settings - Fork 4.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Make AAD resource scope match cloud #20872
Comments
KeyVault gets the resource for authenticating a request from a challenge response sent back from the KV service. ACR doesn't have the same paradigm, so we won't follow this precedent. |
Discussion in prior issue: #18520 (comment) Per this comment, storage hardcodes the resource scope. Per offline discussion with @schaabs and @christothes, we'd like to avoid exposing this in Given this discussion and the confirmation from service team that registry URI contains the necessary information to distinguish between clouds, we will move forward with the approach where we obtain the cloud identity from the registry URI and map this to the appropriate token scope. |
List of cloud suffixes can be obtained from the
|
Cloud endpoint URIs are available in Azure.Identity here, if relevant: https://github.com/Azure/azure-sdk-for-net/blob/master/sdk/identity/Azure.Identity/src/AzureAuthorityHosts.cs |
@pallavit @jeremymeng @seankane-msft FYI re: updated implementation plan above. |
We are currently hard-coding resource scope in the client:
azure-sdk-for-net/sdk/containerregistry/Azure.Containers.ContainerRegistry/src/ContainerRegistryClient.cs
Line 22 in 05144b7
We'll need to use a different resource id per cloud:
https://docs.microsoft.com/en-us/azure/active-directory/managed-identities-azure-resources/services-support-managed-identities#azure-resource-manager
The registry domain will be different for every cloud, we have myregistry.azurecr.io for public, myregistry.azurecr.cn for China etc. We will obtain the cloud identity from the registryURI and set the resource id based on that value.
See comments for discussion of what libraries in the SDK do -- it varies based on service implementation.
Updated implementation plan
We will add an
AuthenticationScope
field toContainerRegistryClientOptions
. For now, if this value is set, it will override the authentication scope we're using to obtain the AAD token, which otherwise will default to the scope we're currently using -- which gives access to the public cloud.From a customer perspective, to use the SDK library with a non-public cloud, the
AuthenticationScope
value will need to be set to the correct value.The text was updated successfully, but these errors were encountered: