EmailTokenProvider<TUser> Class¶
TokenProvider that generates tokens from the user’s security stamp and notifies a user via email.
- Namespace
Microsoft.AspNetCore.Identity
- Assemblies
- Microsoft.AspNetCore.Identity
Inheritance Hierarchy¶
System.Object
Microsoft.AspNetCore.Identity.TotpSecurityStampBasedTokenProvider{{TUser}}
Microsoft.AspNetCore.Identity.EmailTokenProvider<TUser>
Syntax¶
public class EmailTokenProvider<TUser> : TotpSecurityStampBasedTokenProvider<TUser>, IUserTwoFactorTokenProvider<TUser> where TUser : class
-
class
Microsoft.AspNetCore.Identity.
EmailTokenProvider<TUser>
¶
Methods¶
-
CanGenerateTwoFactorTokenAsync
(Microsoft.AspNetCore.Identity.UserManager<TUser>, TUser)¶ Checks if a two factor authentication token can be generated for the specified <em>user</em>.
Arguments: - manager (Microsoft.AspNetCore.Identity.UserManager<TUser>) – The
Microsoft.AspNetCore.Identity.UserManager`1
to retrieve the <em>user</em> from. - user (TUser) – The <em>TUser</em> to check for the possibility of generating a two factor authentication token.
Return type: System.Threading.Tasks.Task<System.Boolean>
Returns: True if the user has an email address set, otherwise false.
public override Task<bool> CanGenerateTwoFactorTokenAsync(UserManager<TUser> manager, TUser user)
- manager (Microsoft.AspNetCore.Identity.UserManager<TUser>) – The
-
GetUserModifierAsync
(System.String, Microsoft.AspNetCore.Identity.UserManager<TUser>, TUser)¶ Returns the a value for the user used as entropy in the generated token.
Arguments: - purpose (System.String) – The purpose of the two factor authentication token.
- manager (Microsoft.AspNetCore.Identity.UserManager<TUser>) – The
Microsoft.AspNetCore.Identity.UserManager`1
to retrieve the <em>user</em> from. - user (TUser) – The <em>TUser</em> to check for the possibility of generating a two factor authentication token.
Return type: System.Threading.Tasks.Task<System.String>
Returns: A string suitable for use as entropy in token generation.
public override Task<string> GetUserModifierAsync(string purpose, UserManager<TUser> manager, TUser user)
-