-
Notifications
You must be signed in to change notification settings - Fork 3.3k
Open
Labels
KeyVaultneeds-triageWorkflow: This is a new issue that needs to be triaged to the appropriate team.Workflow: This is a new issue that needs to be triaged to the appropriate team.
Description
The Key Vault challenge authentication policy incorrectly parses the tenant ID from dSTS authority URLs. This causes authentication failures when using KeyVault with dSTS-based endpoints.
dSTS authority URLs have a different structure than standard Entra ID URLs:
- Standard:
https://login.microsoft.com/{tenant-id} - dSTS:
https://uswest2-passive-dsts.dsts.core.windows.net/dstsv2/{tenant-id}/
The current code in http_challenge.py extracts the first path segment as the tenant ID:
uri_path = raw_uri_path.lstrip("/")
self.tenant_id = uri_path.split("/", maxsplit=1)[0] or NoneFor a dSTS authority URL, this incorrectly extracts dstsv2 (a path prefix) instead of the actual tenant GUID.
Affected packages
azure-keyvault-keysazure-keyvault-secretsazure-keyvault-certificatesazure-keyvault-administrationazure-keyvault-securitydomain
Reproduction
from azure.keyvault.keys._shared.http_challenge import HttpChallenge
tenant_guid = "d01e93db-8e88-4f53-b4fc-8cf680ccf3d1"
dsts_authority = f"https://uswest2-passive-dsts.dsts.core.windows.net/dstsv2/{tenant_guid}"
challenge = HttpChallenge(
"https://request.uri",
challenge=f'Bearer authorization="{dsts_authority}", resource=https://some.resource',
)
print(f"Extracted tenant_id: {challenge.tenant_id}")
# Actual: "dstsv2"
# Expected: "d01e93db-8e88-4f53-b4fc-8cf680ccf3d1"Related issue: Azure/azure-sdk-for-net#56394
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
KeyVaultneeds-triageWorkflow: This is a new issue that needs to be triaged to the appropriate team.Workflow: This is a new issue that needs to be triaged to the appropriate team.
Type
Projects
Status
Untriaged