Adding cookie consent causes HTTP 417: Expectation Failed in the back office
Hi folks, I added a cookie consent banner to my website using the standard .NET UseCookieConsent() middleware. However, this started throwing 417 error codes in the back office, resulting in the nodes failing to load and the backoffice becoming completely unusable - the same happens when deployed to my remote host. Error message shown below:
Possibly unhandled rejection: {"errorMsg":"Failed to get cultures","data":{"Type":null,"Title":null,"Status":417,"Detail":null,"Instance":null,"Extensions":{"traceId":"00-d9b0ecde07e5815e972858eade6a6394-afc12ffd089185a8-00"}},"status":417,"xhrStatus":"complete"}
Additional errors with the same error code are raised for the following API calls:
GetCheck
AllowsCultureVariation
GetSections
GetTours
This may relate to the ValidateAngularAntiForgeryTokenAttribute , which returns an error from the call to ValidateRequestAsync on BackOfficeAntiforgery, which then throws the Expectation Failed result, however I don't know how to resolve this issue from my side without there being changes to the Umbraco source code.
Adding cookie consent causes HTTP 417: Expectation Failed in the back office
Hi folks, I added a cookie consent banner to my website using the standard .NET
UseCookieConsent()
middleware. However, this started throwing 417 error codes in the back office, resulting in the nodes failing to load and the backoffice becoming completely unusable - the same happens when deployed to my remote host. Error message shown below:Additional errors with the same error code are raised for the following API calls:
This may relate to the ValidateAngularAntiForgeryTokenAttribute , which returns an error from the call to
ValidateRequestAsync
on BackOfficeAntiforgery, which then throws the Expectation Failed result, however I don't know how to resolve this issue from my side without there being changes to the Umbraco source code.Any ideas?
By coinicidence, I'm dealing with the same issue! I think this is relevant ... https://our.umbraco.com/forum/using-umbraco-and-getting-started/107782-reverting-content-http-417s-and-strange-azure-behaviour#comment-335191
I'm going to try setting backoffice cookies to be regarded as necessary ... as soon as I figure out which ones are strictly necessary.
Hi Alan, how do you specify cookie necessity? Is it something in the Startup class? I'm using Umbraco V10.
is working on a reply...