© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
C#C
C#•3y ago•
1 reply
illunix

❔ Error about anti-forgery on production when try hit api endpoint

Hello, when I try hit the endpoint I get this error, when I debug my app I don't get any error like this, but when my app is on kubernetes, I get

contains anti-forgery metadata, but a middleware was not found that supports anti-forgery.
Configure your application startup by adding app.UseAntiforgery() in the application startup code. If there are calls to app.UseRouting() and app.UseEndpoints(...), the call to app.UseAntiforgery() must go between them. Calls to app.UseAntiforgery() must be placed after calls to app.UseAuthentication() and app.UseAuthorization().
C# banner
C#Join
We are a programming server aimed at coders discussing everything related to C# (CSharp) and .NET.
61,871Members
Resources

Similar Threads

Was this page helpful?
Recent Announcements

Similar Threads

anti forgery token asp global asax file
C#CC# / help
4y ago
✅ controller endpoint gets 404 when hit
C#CC# / help
3y ago
❔ Error on my try and catch
C#CC# / help
3y ago
asp - Calling another api endpoint
C#CC# / help
2y ago