You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Better error message for AntiforgeryValidationException: The provided antiforgery token was meant for a different claims-based user than the current userΒ #63218
Is your feature request related to a problem? Please describe the problem.
AntiforgeryValidationException: The provided antiforgery token was meant for a different claims-based user than the current user is incrediable annoying because it gives you very little actual information about what is going on...
A VERY common issue is that someone put .UseAntiforgery() before .UseAuth..., and it would be really if the error message could catch this very common case.
should report a different error if httpContext.User.IsAuthenticated == false, example AntiforgeryValidationException: The provided antiforgery token was meant for an authenticated user, but current user is not authenticated. Did you put .UseAntiforgery() after .UseAuthentication()?.