The docs from Firebase suggest that the API offers the same features as the console:
It is not always convenient to have to visit the Firebase console in order to manage your Firebase users. The admin user management API provides programmatic access to those same users. It even allows you to do things the Firebase console cannot, such as retrieving a user's full data and changing a user's password, email address or phone number.
But the reference docs don't list a function to reset a user's password. Am I missing something?
EDIT: This answer is now out of date, see Andrea's answer below for how to send a password reset link through the Firebase SDK.
It depends on which definition of 'reset' you're using.
If you mean reset as in 'change', then yes - the updateUser
function allows you to provide a new password. See the following example from the docs:
admin.auth().updateUser(uid, {
email: "modifiedUser@example.com",
phoneNumber: "+11234567890",
emailVerified: true,
password: "newPassword",
displayName: "Jane Doe",
photoURL: "http://www.example.com/12345678/photo.png",
disabled: true
})
.then(function(userRecord) {
// See the UserRecord reference doc for the contents of userRecord.
console.log("Successfully updated user", userRecord.toJSON());
})
.catch(function(error) {
console.log("Error updating user:", error);
});
If, on the other hand, you mean reset as in 'send a password reset email', then no, there doesn't seem to be a simple way of doing so via the Admin SDK.