Delen via


UserManager<TUser>.GenerateNewTwoFactorRecoveryCodesAsync Method

Definition

Generates recovery codes for the user, this invalidates any previous recovery codes for the user.

public:
 virtual System::Threading::Tasks::Task<System::Collections::Generic::IEnumerable<System::String ^> ^> ^ GenerateNewTwoFactorRecoveryCodesAsync(TUser user, int number);
public virtual System.Threading.Tasks.Task<System.Collections.Generic.IEnumerable<string>> GenerateNewTwoFactorRecoveryCodesAsync (TUser user, int number);
public virtual System.Threading.Tasks.Task<System.Collections.Generic.IEnumerable<string>?> GenerateNewTwoFactorRecoveryCodesAsync (TUser user, int number);
abstract member GenerateNewTwoFactorRecoveryCodesAsync : 'User * int -> System.Threading.Tasks.Task<seq<string>>
override this.GenerateNewTwoFactorRecoveryCodesAsync : 'User * int -> System.Threading.Tasks.Task<seq<string>>
Public Overridable Function GenerateNewTwoFactorRecoveryCodesAsync (user As TUser, number As Integer) As Task(Of IEnumerable(Of String))

Parameters

user
TUser

The user to generate recovery codes for.

number
Int32

The number of codes to generate.

Returns

The new recovery codes for the user. Note: there may be less than number returned, as duplicates will be removed.

Applies to