-
Notifications
You must be signed in to change notification settings - Fork 10.5k
Closed
Labels
area-blazorIncludes: Blazor, Razor ComponentsIncludes: Blazor, Razor Componentsfeature-blazor-wasmThis issue is related to and / or impacts Blazor WebAssemblyThis issue is related to and / or impacts Blazor WebAssembly
Milestone
Description
Hello,
I am trying to add antiforgery protection to the EditForm for login and registration.
I have added the [AutoValidateAntiforgeryToken] attribute for the controller
and the following coding at startup for the server part:
services.AddMvc(options =>
{
options.Filters.Add(new AutoValidateAntiforgeryTokenAttribute());
});
The server response is 400 Bad request when a log in operation is submitted.
How to resolve it? Is there an anti-forgery mechanism in EditForm? Or with the addition of @Html.AntiForgeryToken()?
Further technical details
ASP.NET Core version 3.1.2
Blazor WebAssembly 3.2.0 Preview 1
Microsoft Edge 82.0.439.1
It's a Blazor Web Assembly with ASP.NET core hosted
Visual Studio 16.5.0 Preview 5.0
Metadata
Metadata
Assignees
Labels
area-blazorIncludes: Blazor, Razor ComponentsIncludes: Blazor, Razor Componentsfeature-blazor-wasmThis issue is related to and / or impacts Blazor WebAssemblyThis issue is related to and / or impacts Blazor WebAssembly