PhoneNumberTokenProvider<TUser> Class

Represents a token provider that generates tokens from a user’s security stamp and sends them to the user via their phone number.

Namespace
Microsoft.AspNetCore.Identity
Assemblies
  • Microsoft.AspNetCore.Identity

Inheritance Hierarchy

Syntax

public class PhoneNumberTokenProvider<TUser> : TotpSecurityStampBasedTokenProvider<TUser>, IUserTwoFactorTokenProvider<TUser> where TUser : class
class Microsoft.AspNetCore.Identity.PhoneNumberTokenProvider<TUser>

Methods

CanGenerateTwoFactorTokenAsync(Microsoft.AspNetCore.Identity.UserManager<TUser>, TUser)

Returns a flag indicating whether the token provider can generate a token suitable for two factor authentication token for the specified <em>user</em>.

Arguments:
Return type:

System.Threading.Tasks.Task<System.Boolean>

Returns:

The System.Threading.Tasks.Task that represents the asynchronous operation, containing the a flag indicating if a two factor token could be generated by this provider for the specified <em>user</em>. The task will return true if a two factor authentication token could be generated as the user has a telephone number, otherwise false.

public override Task<bool> CanGenerateTwoFactorTokenAsync(UserManager<TUser> manager, TUser user)
GetUserModifierAsync(System.String, Microsoft.AspNetCore.Identity.UserManager<TUser>, TUser)

Returns a constant, provider and user unique modifier used for entropy in generated tokens from user information.

Arguments:
Return type:

System.Threading.Tasks.Task<System.String>

Returns:

The System.Threading.Tasks.Task that represents the asynchronous operation, containing a constant modifier for the specified <em>user</em> and <em>purpose</em>.

public override Task<string> GetUserModifierAsync(string purpose, UserManager<TUser> manager, TUser user)