Reputation: 718
Can anyone guide me on how can we add authentication to Elsa's dashboard? Right now, anonymous users can see the workflows and create. I want to restrict this behavior to specific users?
Upvotes: 4
Views: 1886
Reputation: 51
The specifics probably depend on your .net version, but I believe what you want to do is set a fallback policy so that pages/controllers without [Authorize] attribute still require authentication.
Grabbed from https://learn.microsoft.com/en-us/aspnet/core/security/authorization/secure-data?view=aspnetcore-5.0
services.AddAuthorization(options =>
{
options.FallbackPolicy = new AuthorizationPolicyBuilder()
.RequireAuthenticatedUser()
.Build();
});
Upvotes: 1