Firebase email authentication is a secure and easy way to allow users to sign up and log in to your app using their email and password.
Before getting started with this section, ensure you have,
- 1.
- 2.Completed Initial setup required for authentication. (Please note: Skip if you have already enabled authentication and created 'users' collection while creating your project with Firebase Setup.)
Let's see how to add a Firebase email authentication by building an example that looks like this:

Email auth demo
The steps to add Firebase email authentication are as follows:
To enable email authentication in the Firebase:
- 1.
- 2.Click on the Get started button (this may not be visible if you have already set up other forms of Authentication).
- 3.Select the Sign-in method tab.
- 4.Click on Email/Password (Under the 'Native providers' section). If you have already added any other provider, click on Add new provider and then click on Email/Password.
- 5.Find the Email/Password switch and enable it.
- 6.Click on the Save button.
Let's add a page that allows users to create accounts and log in. To speed up, you can add a page from the template. Here is the page added from the templates, and after some modification, it looks the below:

'Auth-2' template
You can create users account using the 'Create Account' action. Here's how you do it:
- 1.Select the widget (e.g., Button) on which you want to add the action.
- 2.
- 3.Search and select the Create Account (under Backend/Database > Firebase Authentication) action.
- 4.Set Auth Provider to Email.
- 5.Set the Email Field dropdown to the widget name that accepts email (e.g., TextFieldEmail).
- 6.Set the Password Field dropdown to the widget name that accepts a password (e.g., TextFieldPassword).
- 7.Similarly, If you have a confirm password field in your UI, set the Confirm Password Field to the appropriate one; otherwise, leave it empty.
- 8.The Create User Document is enabled by default. That means a user document (if it does not already exist with details like email and uid) will be created after the user is authenticated. Typically this will be added to the 'users' collection.
- 1.To create a user document in a different collection, set the Created Document > Collection dropdown to the one you need.
- 2.If you need more details at signup, such as name, age, and birthday, click on the + Add Field and set its value. Ensure that you have already created these fields in a 'users' collection.
To allow users to log in with their credentials, you can use the 'Login' action. Here's how you do it:
- 1.Select the widget (e.g., Button) on which you want to add the action.
- 2.Select Actions from the properties panel (the right menu), If it's the first action, click + Add Action button. Otherwise, click the "+" button below the previous action tile (inside Action Flow Editor) and select Add Action.
- 3.Search and select the Login (under Backend/Database > Firebase Authentication) action.
- 4.Set Auth Provider to Email.
- 5.Set the Email Field dropdown to the widget name that accepts email (e.g., TextFieldEmail).
- 6.Set the Password Field dropdown to the widget name that accepts a password (e.g., TextFieldPassword).
To verify that you have successfully added the email authentication and that users are being created, you can head over to your Firebase project > Authentication > Users and verify the user entries.

Verify user creation in the Firebase console
Last Updated Date: August 10, 2023
Last modified 1mo ago