diff --git a/src/samples/aspnet/Elsa.Samples.HttpEndpointSecurity/Startup.cs b/src/samples/aspnet/Elsa.Samples.HttpEndpointSecurity/Startup.cs index ac63f58446..8adc1f7f82 100644 --- a/src/samples/aspnet/Elsa.Samples.HttpEndpointSecurity/Startup.cs +++ b/src/samples/aspnet/Elsa.Samples.HttpEndpointSecurity/Startup.cs @@ -1,5 +1,7 @@ +using System; using System.IdentityModel.Tokens.Jwt; using System.Text; +using Elsa.Activities.Http.Services; using Elsa.Samples.HttpEndpointSecurity.Options; using Elsa.Samples.HttpEndpointSecurity.Services; using Microsoft.AspNetCore.Authentication.JwtBearer; @@ -61,8 +63,15 @@ public void ConfigureServices(IServiceCollection services) // Elsa. services .AddElsa(elsa => elsa - .AddHttpActivities(http => Configuration.GetSection("Elsa:Server").Bind(http)) - .AddWorkflowsFrom() + .AddHttpActivities(http => + + { + http.HttpEndpointAuthorizationHandlerFactory = + ActivatorUtilities.GetServiceOrCreateInstance; + http.BaseUrl = new Uri(Configuration["Elsa:Server:BaseUrl"]); + http.BasePath = Configuration["Elsa:Server:BasePath"]; + } + ).AddWorkflowsFrom() ); // Application Services.