PhoneNumberTokenProvider<TUser>.CanGenerateTwoFactorTokenAsync Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Returns a flag indicating whether the token provider can generate a token suitable for two-factor authentication token for
the specified user
.
public:
override System::Threading::Tasks::Task<bool> ^ CanGenerateTwoFactorTokenAsync(Microsoft::AspNetCore::Identity::UserManager<TUser> ^ manager, TUser user);
public override System.Threading.Tasks.Task<bool> CanGenerateTwoFactorTokenAsync (Microsoft.AspNetCore.Identity.UserManager<TUser> manager, TUser user);
override this.CanGenerateTwoFactorTokenAsync : Microsoft.AspNetCore.Identity.UserManager<'User (requires 'User : null)> * 'User -> System.Threading.Tasks.Task<bool>
Public Overrides Function CanGenerateTwoFactorTokenAsync (manager As UserManager(Of TUser), user As TUser) As Task(Of Boolean)
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.