# OAuth 2.0 - Auth0

OAuth 2.0 with OpenID Connect with Auth0 provides the ability to use Auth0 as the OAuth vendor and have users login before accessing a web flow in an application.

## Creating an Auth0 Integration for your app

The following link will provide all of the necessary steps for creating an Auth0 Integration: [Open ID Connect Protocol](https://auth0.com/docs/authenticate/protocols/openid-connect-protocol). This is required to obtain the Client ID of the integration as well as the Domain.

When asked for a Redirect URI, add the following Redirect URI. The `{base-domain}` can be found in **Settings**. For example, in the following screenshot, the base domain would be `app.airkit.com`.

![](https://4185914948-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FSItjRhbHaLQ4ar3DUljt%2Fuploads%2Fgit-blob-015c4a2c9fef0308e072379c391f1975c6ed4bc2%2Foauth-20-auth0-v181-0.png?alt=media)

\[block:callout] { "type": "info", "title": "Redirect URIs", "body": "`\nhttps://{base-domain}/internal/session-gateway/v1/oauth/callback`" } \[/block]

## Configuring OAuth in the App

Access your app, go to **Settings > Global** and follow these steps:

1. From the **App Authentication Type** dropdown, select **Secure App**
2. In **Authentication Method**, select **OAuth 2.0 w/ OpenID Connect**
3. As **OAuth Vendor**, choose **Auth0**
4. Enter your OAuth Client ID and the Domain
5. Save your app

![](https://4185914948-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FSItjRhbHaLQ4ar3DUljt%2Fuploads%2Fgit-blob-0a572a2c42251ea57c20ad9bd8ab27ec32b188ce%2Foauth-20-auth0-v181-1.png?alt=media)

## Authentication Success

After setting up you OAuth authentication, go to **Connections Builder** and click on the **On Authentication Success** Event.

The “On Authentication Success” event will run when the user is authenticated. On this event, there is the `event` namespace where you can access data about the user.

```
event.attributes
```

Includes data such as:

* Email
* Picture
* Name
* Locale

```
event.nameId
```

nameId refers to the user’s email address they authenticated with.

To access this data and store it in a session variable, In the Inspector section, click on the **‘+’** icon under Actions and add a **Set Variable** action and set it to a property in the `event` namespace.
