Using User.IsInRole returns random result when UserRole changes
Using User.IsInRole returns random result when UserRole changes I'm using asp.net core 2.1 with default identity settings and every time a role is changed the user should re-login to see the role changes. If I add the following settings, roles should be updated on each request, the Authorize attribute works well but User.IsInRole() method returns random results on each request. Authorize User.IsInRole() services.Configure<SecurityStampValidatorOptions>(options => { options.ValidationInterval = TimeSpan.Zero; }); What's the problem with User.IsInRole() ? How to fix it? User.IsInRole() Edit: I was incorrect about the Authorize attribute behavior, that works random too. Authorize When you say random, do you mean that the changed roles only take sometimes? You could try hooking up OnValidatePrincipal and confirm that it's getting called. – Mark G 2 days ago ...
