# User Auth

This features enables you to add support in your applications for your users to log in using social logins (Google, Github, ...). The data (user accounts and credentials) are stored within *your* database so you can query them like any other object.

{% hint style="info" %}
We currently support this feature with MySQL and MongoDB. If you are interested in using User Auth with PostgreSQL, please reach out to us.
{% endhint %}

## Setup

### **Enable User Auth in the schema**

To use User Auth, your schema needs to have it enabled first. To do this, just click the "Enable User Auth" toggle in the schema editor and create a new commit with the schema.

<figure><img src="/files/7mEztAjwblCGvcL04YTJ" alt="" width="375"><figcaption></figcaption></figure>

### **Configuring User Auth**

Before configuring User Auth, make sure that you have an environment with the new Auth-enabled Commit running (see [Creating a new Environment](/environments/creating-a-new-environment.md)).

Once you configured the environment to use your new commit, you will see a "User Auth" tab in the environment dashboard.

<figure><img src="/files/YIWxVgAO2tWE0SU0bdUc" alt="" width="375"><figcaption></figcaption></figure>

In this tab you'll first set the redirect URL. This is where your application is running at and where your users will be redirected to after a successful login. Here this example is showing `http://example.com`

<figure><img src="/files/q2PfijDfZ0lcvYnabYWD" alt="" width="375"><figcaption></figcaption></figure>

After that you will be prompted to add one or more Authentication Providers.

<figure><img src="/files/Jp4lxYvkMxerFjOkxCzY" alt="" width="375"><figcaption></figcaption></figure>

For every provider you will need a *Client ID* and *Client Secret*.

<figure><img src="/files/wsa4RoaetYFg7svPDgW4" alt="" width="563"><figcaption></figcaption></figure>

To set up the clients at the providers, see one of the following:

* [Google](/guides/user-auth/google.md)
* [GitHub](/guides/user-auth/github.md)
* [GitLab](/guides/user-auth/gitlab.md)

After you are done adding your providers, you can test your login by following the sign-in link below the provider table.

<figure><img src="/files/VdsLXzrSo2K0DuDKdskb" alt=""><figcaption></figcaption></figure>

<figure><img src="/files/migDXrZEtNKmTn7BWyiq" alt="" width="375"><figcaption></figcaption></figure>

### Integration into your application

We make it very easy to add User Auth to your NextJS Application. Just head to<https://github.com/neurelo-public/neurelo-auth-next> and follow the README to get started.

If you would like to use User Auth with a different framework please reach out to us.


---

# Agent Instructions: 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://docs.neurelo.com/guides/user-auth.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.
