To use authentication, you will need to complete the following initial setup:
Skip if you have already enabled authentication while creating a new project with a Firebase setup.
To enable authentication in FlutterFlow:
- 1.Open your FlutterFlow project.
- 2.Open Setting and Integrations () > App Settings > Authentication.
- 3.Turn on the Enable Authentication toggle and select Authentication Type to Firebase.
Enabling authentication in FlutterFlow
The 'user' collection stores the information for authenticated users.
Skip if you have already enabled 'Create User Collection' while creating a new project with a Firebase setup.
Use these steps to create the 'users' collection:
- 1.Click on the Firestore from the Navigation Menu (left side of your screen).
- 2.Click on the + Create Collection button. If you have any other collection already added, you can click on the Plus button ().
- 3.Enter a collection_name (this can be anything, but we recommend 'users') and click on Create button.
- 4.If you enter 'users' a popup will open which asks you to populate this collection with default fields. You can click Yes, and we will add all the fields.
- 5.If you skipped the previous popup but still want to add default fields, you can:
- 1.Switch to the Settings tab.
- 2.Find the Users Collection switch and enable it.
- 3.Find the Collection dropdown below, click on the Unset, and select the name of the collection you just created.
- 4.Now switch to the Collection tab. Now you should see all the default fields.
You do not need to create a password field. This is handled separately by Firebase.
To use the Google or Phone sign-in, you must go through the following steps.
If you aren't planning to use Google or Phone Sign-In, you can skip these steps.
You can generate the SHA-1 key by entering the following command in your terminal with these steps:
- 1.Open a terminal window:
- Mac: Use the Launchpad () or press (â + Spacebar) for Spotlight search, type 'Terminal', and open it.
- Windows: Click the Windows icon, navigate to the 'Windows System' folder, and open 'Command Prompt' either by clicking or right-clicking it.
- 2.Copy the following command (based on your operating system) and select Enter.
keytool -list -v \
-alias androiddebugkey -keystore %USERPROFILE%\.android\debug.keystore
If you get the following error while trying the above command:
ERROR:'keytool' is not recognized as an internal or external command
keytool -list -v \
-alias androiddebugkey -keystore ~/.android/debug.keystore
- 3.After being prompted for the key password, type 'android' and press 'Enter'. Note: For security reasons, you won't see the password as you type it.
Generate SHA-1 key
To add the SHA-1 key in the Firebase Console:
- 2.Scroll down to Your App section.
- 3.Select your Android App from the left side menu.
- 4.Find the SHA certificate fingerprints section and click on the Add fingerprint.
- 5.Enter the generated SHA-1 into the Certificate fingerprint input box.
- 6.Click on the Save button.
After adding the SHA-1 key you must re-generate the config files in FlutterFlow.
To regenerate the config files:
Regenerating config files
Last Updated Date: August 22, 2023