elsa-workflows / elsa-core

A .NET workflows library
https://v3.elsaworkflows.io/
MIT License
6.36k stars 1.17k forks source link

Unable to create working Elsa Studio Blazor Server application as per official documentation #4732

Closed francotiveron closed 9 months ago

francotiveron commented 9 months ago

I did exactly, step by step as described in https://v3.elsaworkflows.io/docs/installation/elsa-studio-blazorserver, building the project fails with error:

Severity    Code    Description Project File    Line    Suppression State
Error   CS1739  The best overload for 'AddRemoteBackend' does not have a parameter named 'configureElsaClientBuilderOptions'    HorthFinancial.NinjaTrader.Workflows.Studio C:\Root\Work\Horth\Work\Ninja\Code\HorthFinancial.NinjaTrader.Workflows.Studio\Program.cs   27  N/A

image

To have something running I modified the source as follows

//builder.Services.AddRemoteBackend(
//    options => configuration.GetSection("Backend").Bind(options),
//    configureElsaClientBuilderOptions: elsaClient => { elsaClient.ConfigureHttpClientBuilder = httpClientBuilder => { httpClientBuilder.AddHttpMessageHandler<AuthenticatingApiHttpMessageHandler>(); }; });

builder.Services.AddRemoteBackend(options => configuration.GetSection("Backend").Bind(options));

With this iI am able to start the application, however, as soon I try to login:

image

image

sfmskywalker commented 9 months ago

Thanks for reporting this issue. The documentation has been updated. The key line missing is this:

builder.Services.AddRemoteBackend(
    elsaClient => elsaClient.AuthenticationHandler = typeof(AuthenticatingApiHttpMessageHandler),
    options => configuration.GetSection("Backend").Bind(options));

I will close this issue as resolved, but please feel free to reopen if you're still having this issue and to continue the conversation.