---
description: (since 6.0.3)
---

# Firebase

4WS.Platform EE support Firebase Authentication for mobile applications.

If you want to use this type of authentication you must define some parameters:

In Administration --> Global Parameters --> **Firebase** group

You must set the JSON Service Account of Firebase project in base64 (you can get this file from the firebase console) and set the company-site for users creation.

For user privacy, you can decide to hide the users data with "Anonymize users data" parameter.

Example:

<figure><img src="https://4214754289-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-M2cc5AJ8EgXTkoN9U07%2Fuploads%2FOGHNzq2P8X1o4bApVIdT%2Fimage.png?alt=media&#x26;token=8f4a44a5-f589-4795-9ae5-527c4a799630" alt=""><figcaption></figcaption></figure>

In **SSO** group you must set the authentication chain (you can specify this for all active applications or you can set this in Application --> Application Detail --> Parameters --> SSO and it's valid only for one application)

<figure><img src="https://4214754289-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-M2cc5AJ8EgXTkoN9U07%2Fuploads%2FZ56QaD2FZJ4pnHKXFeVA%2Fimage.png?alt=media&#x26;token=a9bafb72-45d2-42a8-b588-b1662ad77647" alt=""><figcaption></figcaption></figure>

the authentication class for Firebase&#x20;

<figure><img src="https://4214754289-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-M2cc5AJ8EgXTkoN9U07%2Fuploads%2Fnydmyw9tinfZNGCRHAjn%2Fimage.png?alt=media&#x26;token=553249da-40e0-42bb-b043-a92d36df0122" alt=""><figcaption></figcaption></figure>

and the list of attributes to mapping the Firebase user to the 4WS.Platform user (this mapping used for permissions management)

<figure><img src="https://4214754289-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-M2cc5AJ8EgXTkoN9U07%2Fuploads%2FXFw3qlYzmzJ5G71PrRot%2Fimage.png?alt=media&#x26;token=3e6e6645-4762-4553-a6d5-6bc9d75577a7" alt=""><figcaption></figcaption></figure>

To complete user creation in 4WS.Platform you need to specify in **Permissions** group

<figure><img src="https://4214754289-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-M2cc5AJ8EgXTkoN9U07%2Fuploads%2FCwSokzEXQ1wdifzO4iqE%2Fimage.png?alt=media&#x26;token=ef337977-d28d-4e27-beea-8554014d5a56" alt=""><figcaption></figcaption></figure>

<figure><img src="https://4214754289-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-M2cc5AJ8EgXTkoN9U07%2Fuploads%2F7oh0PswGRaKLiRKzRKel%2Fimage.png?alt=media&#x26;token=d8a18346-9dad-4535-8dbc-11e2a696ba1c" alt=""><figcaption></figcaption></figure>

In this case the user will be create with "APP" role after Firebase authentication is ok.

The last parameter set the database for user synchronization in Security Sync group

<figure><img src="https://4214754289-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-M2cc5AJ8EgXTkoN9U07%2Fuploads%2Fs91im1zliWfOgy74uSMJ%2Fimage.png?alt=media&#x26;token=14854e6d-dd8a-49f9-977c-981a0bfd2988" alt=""><figcaption></figcaption></figure>

Now you can use The Firebase authentication in your application mobile with 4WS.Platform.

In the login request you must send the Firebase username (uid) and the valid token.

Example&#x20;

{% code overflow="wrap" %}
```http
http://localhost:8080/wag/login?applicationId=XXX&appId=XXX&companyId=AAAAA&siteId=100&password=null&languageId=IT&autoLogin=true&username=FIREBASE_UID&ssoToken=FIREBASE_TOKEN
```
{% endcode %}

In the after requests you can send only username and token

{% code overflow="wrap" %}
```http
http://localhost:8080/wag/api?cmd=ALIAS_REQUEST&applicationId=XXX&appId=XXX&username=FIREBASE_UID&restfulToken=FIREBASE_TOKEN
```
{% endcode %}

If the token is no longer valid the client must revalidate the authentication on firebase and recall the login with the new token.
