Antiforgery token error when trying to submit an e...
# help-with-umbraco
v
I am working on an umbraco environment version 10.3.1. I have added a form and set the "EnableFormsApi" to true. The application is headless. Now whenever I want to submit a form from our React application through the api call "POST /umbraco/forms/api/v1/entries/{id}" I retrieve the following error: "status": 500, "detail": "The required antiforgery cookie \".AspNetCore.Antiforgery\" is not present.", upon searching the documentation I stumbled upon the option to work with an API key. I set the "Umbraco:Forms:Security:EnableAntiForgeryTokenForFormsApi" setting to false and added "Umbraco:Forms:Security:FormsApiKey" with a text value. If I Send the POST request now without the "Api-Key" header present I get the following message as expected: "status": 403, "detail": "An API key has been configured for the Umbraco Forms API but no key was found in the request's 'Api-Key' header." The problem is that if I add the API key as a header to the request I get the same error as before, the 500 about the antiforgery. Does anyone know what causes this and how to fix this?
6 Views