【问题标题】:ASP.NET web api 2 how to reset token authentication when password is reset/changeASP.NET web api 2如何在重置/更改密码时重置令牌身份验证
【发布时间】:2017-11-27 19:58:44
【问题描述】:

当用户更改密码时,他们会从应用程序中退出。但是,如果他们同时登录到另一个应用程序,他们仍会在另一个应用程序上保持登录状态。

我想在用户更改密码时从他们登录的所有应用程序中注销用户。

在浏览器中,我们通过此代码检查用户 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 有相同的代码吗?

【问题讨论】:

    标签: asp.net asp.net-web-api asp.net-web-api2 asp.net-identity


    【解决方案1】:

    我认为这个链接会对你有所帮助,

    How to invalidate OAuth token when password is changed?

    【讨论】:

      猜你喜欢
      • 2020-02-29
      • 2015-01-30
      • 1970-01-01
      • 2015-02-21
      • 1970-01-01
      • 2017-09-10
      • 1970-01-01
      • 2019-10-03
      • 1970-01-01
      相关资源
      最近更新 更多