Is it possible to implement Firebase Authentication with Username And Password (not email and Password) in Flutter? Is there a way to do it with the Firebase Auth Plugin?
4 Answers
Logically you can control email address I mean if you want you can maintain email address pattern and store the username for the created UID . Example : Var currentTimeStamp: [email protected]
No Need to verify the email address as you need only the UID Then you have to store the UID ,email address ,along with username in the Firestone or real-time database so that user can login again with the user name .you have to check user name and password is correct or not then do signin with that email addrsss and the given password
Thanks It’s just an idea
Comments
Actually there is a way from the start offered by Firebase. It is by using Custom Auth Tokens (link).
But this is most suitable when you have complete custom server/backend and only want to use Firebase Authentication to handle the authentication.
You will need to create custom auth tokens using the user's user id and password. This can only be done by Firebase Admin SDK (link).
That means this approach needs some kind of server. You can use Google cloud functions or AWS lambda for some cheap options.
Then in order to use the authenticated users, you'll need to implement a function to verify these tokens (link). This gives the UID of the user.