-
Notifications
You must be signed in to change notification settings - Fork 5.1k
Open
Labels
Azure.IdentityClientThis issue is related to a non-management packageThis issue is related to a non-management packageneeds-team-attentionWorkflow: This issue needs attention from Azure service team or SDK teamWorkflow: This issue needs attention from Azure service team or SDK team
Description
DefaultAzureCredentialFactory currently takes the value of the EnvironmentVariables.CredentialSelection and makes it lowecase in order to avoid casing issues.
string credentialSelection = EnvironmentVariables.CredentialSelection?.Trim().ToLower();
However, if current thread culture is Turkish, "AZURECLICREDENTIAL". ToLowerO is equal to "azureclıcredentıal" (notice dotless lowercase 'i'). This creates an invalid value for comparison against the known valid values.
The DefaultAzureCredentialFactory should handle case insensitivity such that other culture settings work without issue.
Repro:
using System.Globalization;
using Azure.Core;
using Azure.Identity;
Thread.CurrentThread.CurrentCulture = new CultureInfo("TR-tr");
Environment.SetEnvironmentVariable(DefaultAzureCredential.DefaultEnvironmentVariableName, "AZURECLICREDENTIAL");
DefaultAzureCredential credential = new DefaultAzureCredential(DefaultAzureCredential.DefaultEnvironmentVariableName);
AccessToken token = credential.GetToken(new TokenRequestContext(scopes: ["[https://vault.azure.net/.default"]));
Console.WriteLine($"Access token acquired. Token type: {token.TokenType}, ExpiresOn: {token.ExpiresOn}");Copilot
Metadata
Metadata
Assignees
Labels
Azure.IdentityClientThis issue is related to a non-management packageThis issue is related to a non-management packageneeds-team-attentionWorkflow: This issue needs attention from Azure service team or SDK teamWorkflow: This issue needs attention from Azure service team or SDK team
Type
Projects
Status
Backlog