I'm using ASP.NET Core 5.0 and I have a claim and role based authentication. I wanna logout the user when i deleted it. I already try to add to my Startup.cs:
services.Configure<SecurityStampValidatorOptions>(options =>
{
// enables immediate logout, after updating the user's security stamp.
options.ValidationInterval = TimeSpan.Zero;
});
and its not working.
I did not use the UserManager on the authentication and authorize.
I think you should be not taking Zero as a value.
Try this:-
services.Configure<SecurityStampValidatorOptions>(options =>
{
options.ValidationInterval = TimeSpan.FromMinutes(1);
});
It's will resolve your issue.