Password reset token provider in ASP.NET core - IUserTokenProvider not found

后端 未结 5 2324
时光说笑
时光说笑 2021-02-09 22:30

Hello,

I googled thoroughly but there is hundred examples from ASP.NET but nothing about ASP.NET Core.

In order to getting password reset work I need to registe

5条回答
  •  长情又很酷
    2021-02-09 22:55

    You can specify one of the built in providers;

    services.AddIdentity(options =>{
            options.Tokens.PasswordResetTokenProvider = TokenOptions.DefaultEmailProvider;
        })
        .AddDefaultTokenProviders();
    

    Or create your own IUserTwoFactorTokenProvider and register it like so;

    services.AddIdentity(options => {
        options.Tokens.PasswordResetTokenProvider = nameof(MyTokenProvider);
    })
    .AddTokenProvider(nameof(MyTokenProvider));
    

提交回复
热议问题