Firebase Authentication
Last updated
Last updated
© 2024 UI Bakery
To provide authentication to your database in UI Bakery, follow the steps described below.
Use this authentication type for testing purposes only since it grants read access for every user.
To grant read permissions in UI Bakery to everyone, follow these steps:
Navigate your Firestore - Rules
Add a code line
After that, you can proceed to UI Bakery and configure your Firestore data source.
If you have already added Cloud 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.
To grant access only to your authorized users, please follow the below steps.
Navigate your Firebase - Authentication - Users
Create a user for UI Bakery authorization (its credentials will be used later for authorization)
Copy its User UID
4. Next, go to your Cloud Firestore and open the Rules tab to configure access rights
5. Add a code line:
Proceed to UI Bakery.
Open Custom Code tab and insert the Firebase connection code:
If you need to enable other Firebase capabilities, you can connect the corresponding Firebase libraries. All available libraries are listed here:
Firebase librariesOnce done, proceed to the Builder to add a Login Action, that will authenticate the user and grant access to your Cloud Firestore. To create a Login Action:
Add a new Action - Code
Specify the code below:
3. Run Action
Please note that the Login Action should be run before any other Action
For example, to read your data with a prior login, do as follows:
add a new Workflow
step 1 - Execute Action - select login Action from the list
step 2 - Code, that will list your data
Use this authentication type for testing purposes only since it grants read access for everyone.
To grant read permissions in UI Bakery to everyone, follow these steps:
Navigate your Realtime Database - Rules
Add a code:
After that, you can proceed to UI Bakery and configure your Realtime Database data source.
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.
To grant access only to your authorized users, please follow these steps.
Navigate your Firebase - Authentication - Users
Create a user for UI Bakery authorization (its credentials will be used later for authorization)
Copy its User UID
4. Next, go to your Realtime DB and open the Rules tab to configure access rights
5. Add a code line
Proceed to UI Bakery.
Open Custom Code tab and insert the Firebase connection code:
If you want to enable other firebase capabilities, you have to connect corresponding firebase libraries. All the available libraries are listed here:
Firebase librariesOnce done, proceed to the Builder to add a Login Action, that will authenticate the user and grant access to your Realtime Database. To create a Login Action:
Add a new Action - Code
Specify the code below:
3. Run Action
Please note that the Login Action should be run before any other Action
For example, to read your data with a prior login, do as follows:
add a new Workflow
step 1 - Execute Action - select login Action from the list
step 2 - Code, that will read your data
Nice job! You can proceed to build your app. The following articles will help you further: