Delen via


UserManager<TUser>.ChangePasswordAsync(TUser, String, String) Method

Definition

Changes a user's password after confirming the specified currentPassword is correct, as an asynchronous operation.

public:
 virtual System::Threading::Tasks::Task<Microsoft::AspNetCore::Identity::IdentityResult ^> ^ ChangePasswordAsync(TUser user, System::String ^ currentPassword, System::String ^ newPassword);
public virtual System.Threading.Tasks.Task<Microsoft.AspNetCore.Identity.IdentityResult> ChangePasswordAsync (TUser user, string currentPassword, string newPassword);
abstract member ChangePasswordAsync : 'User * string * string -> System.Threading.Tasks.Task<Microsoft.AspNetCore.Identity.IdentityResult>
override this.ChangePasswordAsync : 'User * string * string -> System.Threading.Tasks.Task<Microsoft.AspNetCore.Identity.IdentityResult>
Public Overridable Function ChangePasswordAsync (user As TUser, currentPassword As String, newPassword As String) As Task(Of IdentityResult)

Parameters

user
TUser

The user whose password should be set.

currentPassword
String

The current password to validate before changing.

newPassword
String

The new password to set for the specified user.

Returns

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

Applies to