Hi @George_Pillari … putting your request for more details on now to use AppGyver and Firebase in a separate thread in case others are also interested.
Here’s an overview of what you need to setup AppGyver and Firebase REST API.
Refer to the Firebase Auth REST API documentation for more details … https://firebase.google.com/docs/reference/rest/auth/
As well as the Firebase Realtime Database REST API documentation … https://firebase.google.com/docs/database/rest/retrieve-data
Each HTTP call to Firebase Auth has a similar layout.
Create an object for the HTTP request body
Assign the values to the request body
Build a HTTP request function using a URL and request body
Create an object and manually assign the values from the HTTP response
Couple of things to note:
A login request returns an id_token and a refresh_token (see STEP 1)
The id_token expires after 60 min
You can request a new id_token using the refresh_token (see STEP 2)
You use the id_token when making standard get and update calls to your Firebase Realtime Database using the AppGyver REST API direct integration. The id_token is passed as an auth query parameter.
You can store the refresh_token using the AppGyver Client side storage data functions to automatically log people back in when the re-open the app. Just remember to resave the returned refresh_token after each refresh.
New account, password reset, and other Firebase Auth REST API calls are all similar. Refer to the Firebase Auth REST API documentation for details on what fields to include in the HTTP request body and response as well as the URL … https://firebase.google.com/docs/reference/rest/auth/
STEP 1: Log In
1.a) Inside AppGyver, create a firebaseSignIn object as follows …
1.b) Assign values to the firebaseSignIn object. The email and password fields would be entered by the user on the login screen.
1.c) Build a data HTTP request function.
The full URL is https://identitytoolkit.googleapis.com/v1/accounts:signInWithPassword?key=[your firebase application key]
1.d) Create a firebaseLoginReponse object as follows …
1.e) Manually assign the output of the HTTP Request function to the firebaseLoginReponse variables using formulas that match the field names …
STEP 2: Token Refresh
2.a) Inside AppGyver, create a firebaseRefreshRequest object as follows …
2.b) Assign values to the firebaseRefreshRequest object. Use the refresh_token the you stored from step 1.
2.c) Build a data HTTP request function.
The full URL is https://securetoken.googleapis.com/v1/token?key=[your firebase application key]
2.d) Create a firebaseRefreshReponse object as follows …
2.e) Manually assign the output of the HTTP Request function to the firebaseRefreshReponse variables using formulas that match the field names …