Search code examples
androidfirebasefirebase-authenticationlogin-page

How can I make my login as ID & password in Firebase?


As you know, in Firebase you have to choose methods of authentication and in my Android application, I want to make it with ID number & password.

But when I try to choose the Email/password method, I have to write a real E-mail not an ID number. The login page in my android app:

The login page in my android app


Solution

  • I suppose you could store the email by id.

    'someid'{
      'email':'[email protected]',
      'id':12345
    }
    

    When someone enters the id, wither it be the key for the object or the stored id on the object, you can retrieve the email from firebase. Once you get the email you can use that email to log into the application.

    If your trying to avoid using emails at all, then you could just use a fake email and format it like

    [id]@email.com
    

    Then you would just take the entered id and append the rest to make it a valid email.

    Of course all of this would have to be set up in fire-base as a legitimate account for authentication to work .