> For the complete documentation index, see [llms.txt](https://jolzee.gitbook.io/leopard/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://jolzee.gitbook.io/leopard/integrations/social-authentication.md).

# Social Authentication

Once a user is authenticated their full name and email address will be sent to Teneo along with every request.

{% hint style="info" %}
Longer term I would like to only send an auth token to Teneo and have Teneo validate that token and then retrieve the user information directly from Firebase.&#x20;
{% endhint %}

## Screenshots

{% tabs %}
{% tab title="Authenticated" %}

<div align="left"><img src="/files/-LdPZ7mdb-OGll8Fy-iP" alt=""></div>
{% endtab %}

{% tab title="Menu Options" %}

<div align="left"><img src="/files/-LdPZCkRMyj3xCfDgEl5" alt=""></div>
{% endtab %}

{% tab title="Registration" %}

<div align="left"><img src="/files/-LdPZHOm8vkCWN95Sw7U" alt=""></div>
{% endtab %}

{% tab title="Login" %}

<div align="left"><img src="/files/-LdPZLkMgaFXI3-Icejk" alt=""></div>
{% endtab %}
{% endtabs %}

## Firebase and Leopard Config

You will need to setup a Firebase project and enable social authentication for the following Sign-in providers:&#x20;

* Email/Password
* Google
* Facebook
* GitHub

Define your Firebase configuration in [Leopard's Build Variables](/leopard/installation/build-variables.md).

{% code title="" %}

```javascript
const config = {
  ...,
  /**
   * Social Authentication is provided through https://firebase.google.com/
   * Empty values signals no authentication
   */
  socialAuthentication: {
    firebase: {
      apiKey: "",
      authDomain: "",
      databaseUrl: "", // Firebase Realtime Database
      messagingSenderId: "",
      microsoft: {
        domainHint: "", // my-domain.com
        tenant: "" // Azure AD Tenant ID
      },
      projectId: "", // firebase project id
      providers: ["microsoft", "facebook", "google", "github"], // login and register will only show buttons for these providers
      storageBucket: ""
    }
  },
  ...
};

module.exports = config;

```

{% endcode %}

## Capture Email and Name in Teneo

{% code title="Pre-processing Script in Teneo" %}

```groovy
if (engineEnvironment.getParameter("name")) { 
	Lib_sUserFirstName = engineEnvironment.getParameter("name").split()[0]
}

if (engineEnvironment.getParameter("email")) { 
	globalUserEmail = engineEnvironment.getParameter("email")
}
```

{% endcode %}


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://jolzee.gitbook.io/leopard/integrations/social-authentication.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
