User Password Management
This guide shows how to manage the user passwords.
Change user password
To change user password, use the
This function allows you to change password without user losing access to their data (data encryption keys) and data shared with them.
pure.changeUserPassword(userId, oldPassword, newPassword);
Recover user password
To recover user password in case the user forgot it, use the
This function allows you to set up a new password without user losing access to data encrypted for them. Note that the recovery process is rate limited and requires the server to ensure authenticity of the user that is being recovered with two-factor authentication.
Reset user password
To reset user password, PureKit provides you with the
resetUserPassword function. This function works in the following way:
- Resets user password;
- Removes user's access to all their data, therefore user won't be able to decrypt encrypted data anymore;
- Removes user's access to all data shared with this user;
- Removes other users' access to all data shared with them by current user.
open fun resetUserPassword(userId: String!, newPassword: String!): Unit
If you don't need to remove access to data encrypted for this user, use
recoverUser function instead of
To delete the user and remove access to their data, use the
deleteUser function. This function deletes user with the given
Remove user's access to encrypted data
In order to remove user's access to the data that is encrypted for this user, use the
deleteKey function. This function deletes the key, generated at the Data Encryption step for the given
Warning! Other users will also lose access to this data.