1

I'm trying to develop an Android app and I am using Firebase. I've set up the authentication system and works fine.

However I need an Admin interface that can manage Users:

  • to be able to delete user authentication credentials (but not user data)

  • to be able to screen potential users that register. After registration, the verification mail to be triggered by the Admin.

Currently all user related methods like user.isEmailVerified() and user.delete() can be triggered by the user that is authenticated.

I need to retrieve user ID and be able to send verification mail or delete user.

Is this the only way to modify user data?

Thanks

Frank van Puffelen
  • 565,676
  • 79
  • 828
  • 807
Timur
  • 13
  • 2

2 Answers2

0

I have some admin type functionality similar to yours in an app that I have and what I had to do for a lot of the admin type things like deleting user accounts/etc is using Firebase functions and utilizing the firebase admin SDK to do those type of activities.

Jeff LaFay
  • 12,882
  • 13
  • 71
  • 101
0
  • To delete user authentication credentials, you can access the Firebase Console and remove desired user. You can also just suspend it.

  • The verification email can be sent only to the user that signs in, cannot be sent to a single user.

If you want to get the uid of your authenticated user, you need to use the following line of code:

String uid = FirebaseAuth.getInstance().getCurrentUser().getUid();

If you want all the ids of all your users, you need to add them first to a Firebase database and then attach a listener on that particular reference.

Alex Mamo
  • 130,605
  • 17
  • 163
  • 193
  • Salut Alex :). I did some more digging and the Admin SDK for Firebase lets you change user data outside the console. I need to be able to do the changes from inside the app. Currently I can get a list of all users in the database and even delete their data but not authentication credentials. – Timur Feb 21 '18 at 10:29