PhoneNumberTokenProvider<TUser>.CanGenerateTwoFactorTokenAsync Method

Definition

Returns a flag indicating whether the token provider can generate a token suitable for two-factor authentication token for the specified user.

C#
public override System.Threading.Tasks.Task<bool> CanGenerateTwoFactorTokenAsync (Microsoft.AspNetCore.Identity.UserManager<TUser> manager, TUser user);

Parameters

manager
UserManager<TUser>

The UserManager<TUser> that can be used to retrieve user properties.

user
TUser

The user a token could be generated for.

Returns

The 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 user. The task will return true if a two-factor authentication token could be generated as the user has a telephone number, otherwise false.

Applies to

Product Versions
ASP.NET Core 1.0, 1.1, 2.0, 2.1, 2.2, 3.0, 3.1, 5.0, 6.0, 7.0, 8.0, 9.0