Password Change

Since the device does not know the password and is unable to verify the password without the help of the server-side, you need to first call an endpoint that verifies a signature computed with the password.

// Change password from "oldPassword" to "newPassword".
try {
    await powerAuth.changePassword(PowerAuthPassword.fromString("oldPassword"), PowerAuthPassword.fromString("newPassword"));
} on PowerAuthException catch (e) {
    print('Change failed: ${e.code}');
} catch (e) {
    print('Unexpected error: $e');
}

This method calls /pa/v3/signature/validate under the hood with a 2FA signature with the provided original password to verify the password correctness.

Last updated on May 02, 2025 (14:06) Edit on Github Send Feedback
Search

1.0.0.beta

PowerAuth Mobile Flutter