# 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="https://3406482452-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FvzFLT4zSSU6J1uzbt5OF%2Fuploads%2FyUFaPZb6c29HFaNMqfBt%2FScreenshot%202024-09-19%20at%2013.48.31.jpg?alt=media&#x26;token=3461d542-7484-4796-a7de-cb21141e7a13" 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](https://docs.neurelo.com/environments/creating-a-new-environment "mention")).

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

<figure><img src="https://3406482452-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FvzFLT4zSSU6J1uzbt5OF%2Fuploads%2FRQl86Va1E21jzwlgu0b9%2FScreenshot%202024-09-19%20at%2014.01.38.jpg?alt=media&#x26;token=6b72440a-5425-4606-b597-78c4384ff8cf" 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="https://3406482452-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FvzFLT4zSSU6J1uzbt5OF%2Fuploads%2FCog4xEGYe1hWsuFzduDV%2FScreenshot%202024-09-19%20at%2013.55.04.jpg?alt=media&#x26;token=773a9871-6031-49bb-b0ab-4dd1bf232dd2" alt="" width="375"><figcaption></figcaption></figure>

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

<figure><img src="https://3406482452-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FvzFLT4zSSU6J1uzbt5OF%2Fuploads%2FASK6c8Xei5c5NpzT5OdA%2FScreenshot%202024-09-19%20at%2013.55.30.jpg?alt=media&#x26;token=378e3cbe-45de-4df5-96a1-42f42c4ef861" alt="" width="375"><figcaption></figcaption></figure>

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

<figure><img src="https://3406482452-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FvzFLT4zSSU6J1uzbt5OF%2Fuploads%2FrzJWD1pdtg1FXDlbxPSJ%2FScreenshot%202024-09-19%20at%2013.56.06.jpg?alt=media&#x26;token=4e763a89-f01a-4565-b163-9a2046e57827" alt="" width="563"><figcaption></figcaption></figure>

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

* [google](https://docs.neurelo.com/guides/user-auth/google "mention")
* [github](https://docs.neurelo.com/guides/user-auth/github "mention")
* [gitlab](https://docs.neurelo.com/guides/user-auth/gitlab "mention")

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="https://3406482452-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FvzFLT4zSSU6J1uzbt5OF%2Fuploads%2FBR4jQab9nciy1RlyrMdI%2FScreenshot%202024-09-19%20at%2013.58.28.jpg?alt=media&#x26;token=67c68020-a893-4765-b209-4fea9f9df388" alt=""><figcaption></figcaption></figure>

<figure><img src="https://3406482452-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FvzFLT4zSSU6J1uzbt5OF%2Fuploads%2FaOnosYSiJzFgCUcMBTk5%2FScreenshot%202024-09-19%20at%2013.58.53.jpg?alt=media&#x26;token=74221ab8-a603-4f5f-9507-a8c385d6f18c" 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.
