Base solution for your next web application
Open Closed

AntiforgeryValidationException on swagger post calls #11094


User avatar
0
Goontech created

Version :API: v11.0.0 | Client: v11.0.0 (Angular + MVC)

On azure web app deployed api swagger post methods call returning below exception(log.txt): Swagger returns 200. PFA.

logs.txt: ERROR 2022-06-05 21:38:02,347 [orker] idateAntiforgeryTokenAuthorizationFilter - The provided antiforgery token was meant for a different claims-based user than the current user. Microsoft.AspNetCore.Antiforgery.AntiforgeryValidationException: The provided antiforgery token was meant for a different claims-based user than the current user. at Microsoft.AspNetCore.Antiforgery.DefaultAntiforgery.ValidateTokens(HttpContext httpContext, AntiforgeryTokenSet antiforgeryTokenSet) at Microsoft.AspNetCore.Antiforgery.DefaultAntiforgery.ValidateRequestAsync(HttpContext httpContext) at Abp.AspNetCore.Mvc.Antiforgery.AbpValidateAntiforgeryTokenAuthorizationFilter.OnAuthorizationAsync(AuthorizationFilterContext context)

P.S. Get calls working fine. Application localhost works as expected, getting above AntiforgeryValidationException for deployed(azure) post methods calls. I tried with clearing cache and using different browsers.


1 Answer(s)
  • User Avatar
    0
    ismcagdas created
    Support Team

    Hi,

    Could you apply changes on this pull request and see if it solves your problem ?

    Thanks,