[BUG] [Azure.Identity] SharedTokenCacheCredential throws error "Multiple accounts matching the specified..." #18276
Labels
Azure.Identity
Client
This issue points to a problem in the data-plane of the library.
needs-team-triage
Workflow: This issue needs the team to triage.
Describe the bug
Please provide the description of issue you're seeing.
This is based on the issue Azure/azure-powershell#14023 reported by Azure PowerShell user.
If there're multi tenants for one account, when calling SharedTokenCacheCredential.GetToken with tenantId and _skipTenantValiation as true, we'll get error that "Multiple accounts matching the specified ...", it looks like a bug at
https://github.com/Azure/azure-sdk-for-net/blob/master/sdk/identity/Azure.Identity/src/SharedTokenCacheCredential.cs#L148-L159.
We probably need to change the logic to:
Expected behavior
What is the expected behavior?
Actual behavior (include Exception or Stack Trace)
What is the actual behavior?
Get the following error:
To Reproduce
Steps to reproduce the behavior (include a code snippet, screenshot, or any additional information that might help us reproduce the issue)
NA
Environment:
dotnet --info
output for .NET Core projects): [e.g. Azure AppService or Windows 10 .NET Framework 4.8]The text was updated successfully, but these errors were encountered: