当用户更改密码时,他们会从应用中退出。但是,如果他们同时登录到另一个应用程序,他们仍然会登录到另一个应用程序。
我想在用户更改密码时从登录的所有应用中注销用户。
在浏览器中,我们通过此代码检查用户cookie
Provider = new CookieAuthenticationProvider
{
// Enables the application to validate the security stamp when the user logs in.
// This is a security feature which is used when you change a password or add an external login to your account.
OnValidateIdentity = SecurityStampValidator.OnValidateIdentity<ApplicationUserManager, ApplicationUser>(
validateInterval: TimeSpan.FromSeconds(1),
regenerateIdentity: (manager, user) => user.GenerateUserIdentityAsync(manager))
}
web api是否有相同的代码?