Manage Email/Password Users - Android SDK¶
When you have enabled the email/password provider in your Realm app, you can register a new account, confirm an email address, and reset a user's password from client code.
Register a New User Account¶
Confirm a New User's Email Address¶
Reset a User's Password¶
To reset a user password in Realm Sync, you can either:
- Send a password reset email
- Run a password reset function
Select your preferred password reset method by going to:
- Your Realm app
- Authentication Providers
- Email/Password - and press the EDIT button
Send a Password Reset Email¶
Password reset emails contain two values,
To complete the password reset flow, prompt the user to enter a new
password and pass the
tokenId values along with the
new password value to your Realm
Run a Password Reset Function¶
When you configure your app to run a password reset function, you'll define the function that should run when you call callResetPasswordFunction() or callResetPasswordFunctionAsync() from the SDK. This function can take a username, a password, and any number of additional arguments. You can use these arguments to specify details like security question answers or other challenges that the user should pass to successfully complete a password reset.
You might prefer to use a custom password reset function when you want to define your own password reset flows. For example, you might send a custom password reset email from a specific domain, or through a service other than email.
For more information on how to define a custom password reset function in the Realm Sync backend, including how to structure it and examples of implementing custom flows, see: Run a Password Reset Function.