Delen via


UserManager<TUser>.SetTwoFactorEnabledAsync(TUser, Boolean) Method

Definition

Sets a flag indicating whether the specified user has two factor authentication enabled or not, as an asynchronous operation.

public:
 virtual System::Threading::Tasks::Task<Microsoft::AspNetCore::Identity::IdentityResult ^> ^ SetTwoFactorEnabledAsync(TUser user, bool enabled);
public virtual System.Threading.Tasks.Task<Microsoft.AspNetCore.Identity.IdentityResult> SetTwoFactorEnabledAsync (TUser user, bool enabled);
abstract member SetTwoFactorEnabledAsync : 'User * bool -> System.Threading.Tasks.Task<Microsoft.AspNetCore.Identity.IdentityResult>
override this.SetTwoFactorEnabledAsync : 'User * bool -> System.Threading.Tasks.Task<Microsoft.AspNetCore.Identity.IdentityResult>
Public Overridable Function SetTwoFactorEnabledAsync (user As TUser, enabled As Boolean) As Task(Of IdentityResult)

Parameters

user
TUser

The user whose two factor authentication enabled status should be set.

enabled
Boolean

A flag indicating whether the specified user has two factor authentication enabled.

Returns

The Task that represents the asynchronous operation, the IdentityResult of the operation

Applies to