1

I have an admin setup using angularfire2 and i'm trying to make it so the logged in admin user can update another user's email/password. I know you can call something like this.af.auth.getAuth().auth.updateEmail(this.user.get('email').value) to update the currently logged in user's info, but how to I update a different user's info?

NineBlindEyes
  • 579
  • 8
  • 18
  • Have you considered using firebase-admin node.js? It allows you to update any user using admin privileges: https://firebase.google.com/docs/admin/setup – bojeil Apr 03 '17 at 03:46
  • 1
    You don't in code. Firebase has no concept of 'admin user' (unfortunately) and trying to work with that concept in Firebase is a dead end. – Jay Apr 03 '17 at 19:16
  • Possible duplicate of [Change password with Firebase for Android](http://stackoverflow.com/questions/39866086/change-password-with-firebase-for-android) – Jay Apr 03 '17 at 19:16
  • @Jay Not a duplicate, not even close to what they were asking and completely different platform. – NineBlindEyes Apr 04 '17 at 15:21
  • @Jay They don't have a concept of admin user, but they do have a way to handle security rules so you'd think there would be a way to do it. – NineBlindEyes Apr 04 '17 at 15:23
  • Please read the comments from the question as it's a very similar regardless of platform. This question: *logged in admin user can update another user's email/password* the linked question: *(to update the password) I need the user's current password for comparing with the inputted one* with the answer being *There is no way to retrieve the current password of a user from Firebase Authentication.*. There is no way to retrieve a password for yourself or another user, so it can't be done. Rules will not help as the password for another user cannot be changed in code. – Jay Apr 04 '17 at 17:04
  • This *used* to be doable with Firebase 2.x and when that functionality was removed in Firebase 3, it broke a LOT of code - including ours. So in situations where you need multi-tenant access or Admin type users (in code) Firebase may not be the best solution. – Jay Apr 04 '17 at 17:05

0 Answers0