Firebase authentication
Last updated
Was this helpful?
Last updated
Was this helpful?
This article focuses on how to provide authentication to your Firebase database in UI Bakery:
Use this authentication type for testing purposes only since it grants Read access to every user.
Open your and navigate to Rules.
Add the following line to the code:
If you have already added Firestore as a data source and have an authentication error thrown after any action is run, you might need to adjust your Firestore rules as stated above and then re-run your action in UI Bakery.
The flow to grant access only to your authorized users consists of three steps:
Create a user for UI Bakery authorization - the credentials will be used later.
Copy User UID.
Next, go to your Cloud Firestore and open the Rules tab to configure access rights.
Add the following line to the code:
Now, in UI Bakery, open the project you need in the Builder and click on the Custom code tab in the footer panel. There, insert the Firebase connection code:
Next, you need to create a Login action that will authenticate the user and grant access to your Cloud Firestore.
Click Execute action.
Please note that the Login action should be run before any other action.
For example, to read your data with a prior login, you can create an action consisting of two steps:
Step 1 - select the Execute Action type and choose your login Action from the list.
Use this authentication type for testing purposes only since it grants Read access to everyone.
Open your Realtime Database and navigate to Rules.
There, add the following code:
If you have already added Realtime DB as a datasource and have an authentication error thrown after any action is run, you might need to adjust your Realtime DB rules as stated above and then re-run your action in UI Bakery.
The flow to grant access only to your authorized users consists of three steps:
Create a user for UI Bakery authorization - the credentials will be used later.
Copy User UID.
Next, go to your Realtime DB and open the Rules tab to configure access rights.
Add the following code:
Now, in UI Bakery, open the project you need in the Builder and click on the Custom code tab in the footer panel. There, insert the Firebase connection code:
Next, you need to create a Login action that will authenticate the user and grant access to your Realtime Database.
3. Click Execute action.
Please note that the Login action should be run before any other action.
For example, to read your data with a prior login, you can create an action consisting of two steps:
Step 1 - select the Execute Action type and choose your login Action from the list.
After that you can proceed to UI Bakery and configure your .
Open your and navigate to Authentication > Users.
If you need to enable other Firebase capabilities, you can connect the corresponding Firebase library. You can find all available libraries listed .
of the JavaScript Code type and add the following code:
Step 2 - select the JavaScript Code action type and add the code that will .
After that you can proceed to UI Bakery and configure your .
Open your and navigate to Authentication > Users.
If you need to enable other Firebase capabilities, you can connect the corresponding Firebase library. You can find all available libraries listed .
of the JavaScript Code type and add the following code:
Step 2 - select the JavaScript Code action type and add the code that will .
Explore the following article to proceed with building your app and managing Firebase data