sketchub icon

Login with Username instead of Email address

IO_Inc
4 Likes
1 Comments
19 Downloads

Screenshots

About

This solution enables Firebase login using a username instead of an email. It leverages Firebase Realtime Database to store user data, including usernames and associated emails. Upon login, the system queries the database for a matching username, retrieves the corresponding email, and then uses Firebase Authentication's signInWithEmailAndPassword with the retrieved email and provided password. This approach separates user identification from email-based authentication, allowing users to log in using their preferred usernames, while still relying on Firebase for secure password handling.

Note: Create a private AuthManager authManager and make changes to the Firebase Auth and Database to your specification Add the AuthManager.java for authentication and verification of the username that contains the email address And make sure you correct the firebase manager in the library activity And make sure the rules to your realtime database is this:

{ "rules": { "users": { ".read": "auth != null", ".write": "auth != null" } } }

And your realtime database user should look like this:

users

  • user_uid_1

©2025 Sketchub | User Policy