To update firebase user details first we have to Retrieve user data based on Email Address
UserRecord userRecord = await FirebaseAuth.DefaultInstance.GetUserByEmailAsync("youremail@domain.com");
Now we can Update a user using "Uid" which we will get from user data
UserRecordArgs args = new UserRecordArgs()
{
Uid = userRecord.Uid,
PhoneNumber = "+11234567890",
EmailVerified = true,
Password = "New Password",
DisplayName = "Full Name",
PhotoUrl = "photourl",
Disabled = false,
};
UserRecord userRecordUpdate = await FirebaseAuth.DefaultInstance.UpdateUserAsync(args);
Note:
1. To reset password you can use the same code mentioned above. Just Remove all other properties except password
2. To know how to create and register user using the firebase admin Click here
3. To know how to delete user using firbase admin Click here
Additional References:
1. https://firebase.google.com/docs/auth/admin/manage-users#c
Post Comments(0)