dapr / dotnet-sdk

Dapr SDK for .NET
Apache License 2.0
1.12k stars 341 forks source link

[Workflow] Workflow fails when ApiToken is passed into builder when constructing Dapr Client #1134

Closed RyanLettieri closed 1 year ago

RyanLettieri commented 1 year ago

If you try to use Workflows with a Dapr instance that has API authentication enabled, you will fail since the workflow client can't pass the auth token.

Note that this an issue in the underlying durable task framework so it will need a fix in all SDKs for workflow.

Expected Behavior

Expected to have the workflow run with no issues.

Actual Behavior

App continously outputs the following failure statements:

== APP == fail: Microsoft.DurableTask[20] == APP == Unexpected error in handling of instance ID ''. == APP == Grpc.Core.RpcException: Status(StatusCode="Unauthenticated", Detail="Unauthorized") == APP == at Microsoft.DurableTask.Worker.Grpc.GrpcDurableTaskWorker.Processor.ConnectAsync(CancellationToken cancellation) == APP == at Microsoft.DurableTask.Worker.Grpc.GrpcDurableTaskWorker.Processor.ExecuteAsync(String target, CancellationToken cancellation)

Steps to Reproduce the Problem

Open the example program for the workflow console app inside the .NET SDK repo. Add the following to the line where we construct the daprClient (before .Build()): "UseDaprApiToken("apiToken")" (https://github.com/dapr/dotnet-sdk/blob/f4e02df980072438ad225b75412f779df67936a0/examples/Workflow/WorkflowConsoleApp/Program.cs#L50) Run the example

Release Note

RELEASE NOTE:

RyanLettieri commented 1 year ago

/assign