Skip to content

Password Verification

Description

When a user needs to change their password in your application, you may need to verify their existing password for security reasons. Since Backendless stores passwords in the encrypted format and never returns the password value, you need to use the API call documented below to implement password verification. The API checks the provided password value against the one stored in the database. User must be logged - Backendless verifies provided value for the currently logged in user.

This functionality can be used only in CloudCode (Java, JS or Codeless), the reason for this restriction is that a malicious use of this API can easily compromise application's security. As a result, this API must be used from a controlled environment. For information about the API select either Android/Java or JS documentation.

Codeless Reference

user_service_codeless_verify_current_user_password

Returns true if the password is correct, otherwise false.

Consider the following record in the Users data table:
user_service_codeless_example_get_user_roles_example_1

The example below logs in as "alice@wonderland.com" to obtain the user token which is required for this operation. Then it verifies the user password and returns true since passwords match.

user_service_codeless_example_verify_current_user_password