Description
Library name and version
Azure.Identity 1.10.4
Describe the bug
When using credential sources like AzurePowerShellCredential with a ChainedTokenCredential we are unable to leverage the exception handling logic of the Chained credential that allows it to work through the available credential sources, such as inside the AzurePowerShellCredential which throws a CredentialUnavailableException instead of whatever exception was thrown.
This is because the IsChainedCredential
property on TokenCredentialOptions (which classes like AzurePowerShellCredentialOptions extend from) is internal (this property gets translated into the _isChainedCredential
field on the credential sources which feed into the chained throwing logic)
Expected behavior
As a consumer of the ChainedTokenCredential we should be able to set that our credential sources are for chaining so that if one fails the others can be tried
Actual behavior
We are unable to set this variable by hand (what I am doing instead in the meantime is to use System.Reflection to set the _isChainedCredential
field on my Token Sources, if they have the field, before I provide them to my ChainedTokenCredential instance)
Reproduction Steps
n/a
Environment
Runtime Environment:
OS Name: Mac OS X
OS Version: 14.7
OS Platform: Darwin
RID: osx-arm64
Base Path: /usr/local/share/dotnet/sdk/8.0.300/
Metadata
Metadata
Assignees
Labels
Type
Projects
Status