0

I have a user registered on firebase with email as admin@abc.com. When I logs in using admin@abc.com, i have given this user the privilege to add new users. And when admin@abc.com adds any new user using:

FirebaseAuth.getInstance()
        .createUserWithEmailAndPassword(testUser1@gmail.com, abcPass)

the new user testUser1@gmail.com gets created. Here comes the twist. Now when i try to find the uid of currently logged in user, Instead of showing uid of admin@abc.com. It shows the uid of newly created user that is of testUser1@gmail.com.

Now my question is how to tackel this issue keeping in mind that its necessary to create user like i mentioned above or if you have anyother suggestion your are most welcome to share.

Frank van Puffelen
  • 499,950
  • 69
  • 739
  • 734
  • This is the expected behavior: the Firebase Android SDK automatically signs in the user you create, as it is explicitly not intended to be used for admin accounts as yuo are trying. I linked a few questions where this was covered more extensively before. – Frank van Puffelen Apr 27 '22 at 21:49
  • @FrankvanPuffelen thanks a lot. Got the idea. Thank You. – Adnan Qurban Apr 27 '22 at 21:57

0 Answers0