-
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
[BUG]Unexpected Exception thrown when authenticate with chaining credentials #8476
Comments
@tzhanl Thanks for filing this issue. This is expected behavior. The As a related aside. The next release of Azure.Identity will provide an exception type which will be handled by the ChainedTokenCredential and DefaultAzureCredential. PR #8306 introduces the |
Closing this issue. I have opened issues against the other languages to update their behavior. |
Add default=90 to softDeleteRetentionInDays (Azure#8476) * Add default=90 to softDeleteRetentionInDays Add default=90 to softDeleteRetentionInDays * Remove default softDeleteRetentionInDays when patching Remove default softDeleteRetentionInDays when patching.
Add default=90 to softDeleteRetentionInDays (Azure#8476) * Add default=90 to softDeleteRetentionInDays Add default=90 to softDeleteRetentionInDays * Remove default softDeleteRetentionInDays when patching Remove default softDeleteRetentionInDays when patching.
Describe the bug
Authenticate service client with chaining credentials will throw an unexpected exception when the first credential of chaining credentials is invalid in C#. It works in JavaScript,Python and Java. Verified that this bug occurred in KeyClient, SecretClient, CertificateClient, BlobContainerClient, QueueClient and EventHubClient (FileService client cannot verified because it's don't support authenticate with TokenCredential).
Code Snippet
Exception or Stack Trace
Message: "The request to the identity service failed. See inner exception for details."
at Azure.Identity.ManagedIdentityCredential.GetToken(TokenRequest request, CancellationToken cancellationToken) at Azure.Identity.ChainedTokenCredential.GetToken(TokenRequest request, CancellationToken cancellationToken) at Azure.Core.Pipeline.BearerTokenAuthenticationPolicy.d__8.MoveNext() at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at System.Runtime.CompilerServices.ValueTaskAwaiter.GetResult() at Azure.Core.Pipeline.TaskExtensions.EnsureCompleted(ValueTask task) at Azure.Core.Pipeline.BearerTokenAuthenticationPolicy.Process(HttpPipelineMessage message, ReadOnlyMemory1 pipeline) at Azure.Core.Pipeline.HttpPipelinePolicy.ProcessNext(HttpPipelineMessage message, ReadOnlyMemory1 pipeline) at Azure.Core.Pipeline.SynchronousHttpPipelinePolicy.Process(HttpPipelineMessage message, ReadOnlyMemory1 pipeline) at Azure.Core.Pipeline.HttpPipelinePolicy.ProcessNext(HttpPipelineMessage message, ReadOnlyMemory1 pipeline) at Azure.Core.Pipeline.RetryPolicy.d__11.MoveNext() at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at Azure.Core.Pipeline.RetryPolicy.d__11.MoveNext() at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at System.Runtime.CompilerServices.ValueTaskAwaiter.GetResult() at Azure.Core.Pipeline.TaskExtensions.EnsureCompleted(ValueTask task) at Azure.Core.Pipeline.RetryPolicy.Process(HttpPipelineMessage message, ReadOnlyMemory1 pipeline) at Azure.Core.Pipeline.HttpPipelinePolicy.ProcessNext(HttpPipelineMessage message, ReadOnlyMemory1 pipeline) at Azure.Core.Pipeline.SynchronousHttpPipelinePolicy.Process(HttpPipelineMessage message, ReadOnlyMemory1 pipeline) at Azure.Core.Pipeline.HttpPipelinePolicy.ProcessNext(HttpPipelineMessage message, ReadOnlyMemory1 pipeline) at Azure.Core.Pipeline.SynchronousHttpPipelinePolicy.Process(HttpPipelineMessage message, ReadOnlyMemory1 pipeline) at Azure.Core.Pipeline.HttpPipeline.Send(HttpPipelineMessage message, CancellationToken cancellationToken) at Azure.Storage.Blobs.BlobRestClient.Container.d__0.MoveNext() at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at System.Threading.Tasks.ValueTask1.get_Result() at System.Runtime.CompilerServices.ConfiguredValueTaskAwaitable1.ConfiguredValueTaskAwaiter.GetResult() at Azure.Storage.Blobs.BlobContainerClient.d__29.MoveNext() at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at System.Runtime.CompilerServices.ConfiguredTaskAwaitable1.ConfiguredTaskAwaiter.GetResult() at Azure.Storage.TaskExtensions.EnsureCompleted[T](Task1 task) at Azure.Storage.Blobs.BlobContainerClient.Create(PublicAccessType publicAccessType, IDictionary2 metadata, CancellationToken cancellationToken) at StorageBlobAuthIssue.Class.ChainingCredentialsStroageBlobAsync() in C:\Users\azuretest\source\repos\ConsoleApp1\ConsoleApp1\Program.cs:line 45 at StorageBlobAuthIssue.Class.Main() in C:\Users\azuretest\source\repos\ConsoleApp1\ConsoleApp1\Program.cs:line 20
To Reproduce
Repro App:https://github.com/wantedfast/ChainingCredentialsIssue
Expected behavior
Authenticate with the second Credential in the ChainingCredential.
Setup (please complete the following information):
Additional context
Step into Debug works as expected, Step over or F5 get the unexpected exception.
Information Checklist
Kindly make sure that you have added all the following information above and checkoff the required fields otherwise we will treat the issuer as an incomplete report
The text was updated successfully, but these errors were encountered: