c# - Identity 如何知道密码重置 token 是否已被使用?

标签 c# asp.net-mvc asp.net-identity

我已成功将 ASP.NET 实现到 MVC 网站中,并且很想知道 OWIN/Identity 如何知道身份 token 是否已被使用。

link微软说:

Once a forgotten password token has been used, it's invalidated.

但是如果 token 没有存储在任何地方,如何执行呢?

最佳答案

来自您链接的同一页面上的文档:

The SecurityStamp field and associated code provides an extra layer of security to your app, when you change your password, you will be logged out of the browser you logged in with. The SecurityStampValidator.OnValidateIdentity method enables the app to validate the security token when the user logs in, which is used when you change a password or use the external login. This is needed to ensure that any tokens (cookies) generated with the old password are invalidated. In the sample project, if you change the users password then a new token is generated for the user, any previous tokens are invalidated and the SecurityStamp field is updated.

关于c# - Identity 如何知道密码重置 token 是否已被使用?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/57460649/

相关文章:

c# - 在网站内添加 WCF 服务以进行发布

asp.net-mvc - 使用 ViewModel 值初始化模型

asp.net-mvc-5 - Asp.net身份Google帐户ID从openId迁移到oauth

c# - 值 '\r\n' 的格式无效 .","ExceptionType":"System. FormatException

c# - Web Config 转换问题

c# - 如何让 TextBox 只接受数值?

c# - AspNetCore.Identity - 如何为新用户设置 LockoutEnabled = false

c# - Entity Framework linq 查询何时返回动态代理类型,何时不返回?

asp.net-mvc - 是否可以从 URL(基于 Global.asax 路由)获取 Controller 、操作和路由值?

c# - UserManager.AddToRole 不工作 - 外键错误