thumb-add-authentification-page.png

This Authentication component makes it easy to allow users to sign in/up to your app using email address and password, and manage events (access, progression) based on user data.

You need to create a Firebase account to use this component.

Sign in/register to the Firebase console and follow the instructions below.

Configure Firebase console 

Create new project

Follow these instructions to create your application in the Firebase interface. Some of these informations will be required for configuring the component within PandaSuite Studio.

cre_er-un-projet-firebase.png

choisir-un-nom-projet-firebase.png

e_tape-2-projet-firebase.png

 

Enable Email / Password Sign in

In the Firebase console, go to Authentication and the tab "Sign-In Method". Enable Email/Password as shown below.

autoriser-email-mot-de-passe-firebase.png

 

Add Authentication component

In PandaSuite Studio, click Components and choose Authentication. Open the Properties window and copy/paste informations from the Firebase console. 

parame_tres-du-projet-firebase.png

identifiants-projet-firebase.png

ajouter-composant-authentification.png

 

Options of the Authentication component 

These are the options of the Authentication component.

 

Force authentification after (hours)

Force authentification after (hours) is the number of hours after identification where the session remains valid (even without an internet connection). After this number of hours, an internet connection will be required to continue.

If the session is still valid, the user won't need to re-login. By default, the value of 0 creates an infinite session.

 

Force email verification

Force email verification is an additional step of email validation where the person receives an email with a validation web link. This step will be required before accessing the application.

 

Advanced user fields 

Advanced user fields are other fields required for the user registration (position and company).

If you choose this option, you need additional configuration steps in Firebase. Because these fields are stored in a specific Firebase database that you must create beforehand.

Go to Database and Create new database.

cre_er-une-base-de-donne_es-firebase.png

Choose test mode.

commencer-en-mode-test.png

nouvelle-database.png

Go to Rules tab and update the security rules so that you are not blocked after 30 day. Copy-paste the code below:

rules_version = '2';
service cloud.firestore {
  match /databases/{database}/documents {

   // This rule allows anyone on the internet to view, edit, and delete
   // all data in your Firestore database. It is useful for getting
// leaves your app open to attackers. At that time, all client
// requests to your Firestore database will be denied.
//
// Make sure to write security rules for your app before that time, or else
// your app will lose access to your Firestore database
match /users/{userId} {
allow read, write: if request.auth.uid == userId
}
}
}

mettre-a_-jour-re_gles.png

 

Show communication and usage terms 

Show communications and usage terms are the addition of a checkbox for the validation of the conditions of use. A new event is exposed (onTermsClicked) to display them in the studio.

 

Create events based on user data

Associate data with users as a trait from the studio. Traits are related to the concept of markers and can be useful for a very large number of uses such as saving a progression or managing accesses.

One advantage is that data can be modified outside the application by another system. You just have to use the Firebase APIs. And it works in real time.

First start by adding a marker, it automatically creates a new trait.

create-trait-pandasuite.png

Be careful when defining the name of the trait since it is used in the database storage. Be sure to rename it to match your usage. You can ignore the ID, it just has to be unique.

trigger_trait_pandasuite.png

Checkboxes are related to the triggering behaviour of your marker. In our example, it will be triggered at its creation or at its initialisation. You need to add another one with the same trait name to manage deletion for example.

Action is also available on this marker. It corresponds to its triggering and/or suppression depending on its configuration.

 

 

 

Was this article helpful?
0 out of 2 found this helpful

Create today your interactive content

Easy-to-use ∗ Free ∗ No installation

START NOW!