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¶
System.Object
Microsoft.AspNetCore.Identity.TotpSecurityStampBasedTokenProvider{{TUser}}
Microsoft.AspNetCore.Identity.PhoneNumberTokenProvider<TUser>
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: - manager (Microsoft.AspNetCore.Identity.UserManager<TUser>) – The
Microsoft.AspNetCore.Identity.UserManager`1
that can be used to retrieve user properties. - user (TUser) – The user a token could be generated for.
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)
- manager (Microsoft.AspNetCore.Identity.UserManager<TUser>) – The
-
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: - purpose (System.String) – The purpose the token will be generated for.
- manager (Microsoft.AspNetCore.Identity.UserManager<TUser>) – The
Microsoft.AspNetCore.Identity.UserManager`1
that can be used to retrieve user properties. - user (TUser) – The user a token should be generated for.
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)
-