Custom email confirmation token

后端 未结 1 811
逝去的感伤
逝去的感伤 2020-12-19 01:21

I\'m using the Identity 2.0 framework for user management.
Unfortunately, in my use case an account activation/password reset cannot be done using a direct link, so the

相关标签:
1条回答
  • 2020-12-19 01:45

    ASP.NET Identity uses the UserTokenProvider of the UserManager to generate and validate the token. Basically it calls:

    this.UserTokenProvider.GenerateAsync("Confirmation", this, tUser);
    

    to generate the token and

    this.UserTokenProvider.ValidateAsync("Confirmation", token, this, tUser);
    

    to verify it.

    So you can implement your own IUserTokenProvider<TUser, TKey> or extend the the default one and set that as UserManager.UserTokenProvider.

    0 讨论(0)
提交回复
热议问题