> Documentation index: https://sema4.ai/docs/llms.txt
> Web page: https://sema4.ai/docs/v3/deploy/identity-providers/auth0

# Auth0

Configure an Auth0 application so the platform can sign users in over OIDC. Follow these steps, then bring the resulting **Discovery URL**, **Client ID**, and **Client Secret** to your deployment.

**Audience:** IT (the enabler)

> Replace `<YOUR_HOSTNAME>` with your deployment's hostname, and
> `<YOUR_AUTH0_DOMAIN>` with your Auth0 tenant domain (e.g.
> `your-tenant.us.auth0.com`).

## What you'll collect

| Value             | Where it comes from                                   | Environment variable        |
| ----------------- | ----------------------------------------------------- | --------------------------- |
| **Discovery URL** | Your Auth0 domain's OpenID configuration (see Step 4) | `AS_API_OIDC_SERVER`        |
| **Client ID**     | The application's **Settings** tab                    | `AS_API_OIDC_CLIENT_ID`     |
| **Client Secret** | The application's **Settings** tab                    | `AS_API_OIDC_CLIENT_SECRET` |

### Step 1: Create the application

1. In the [Auth0 Dashboard](https://auth0.com/docs/get-started/auth0-overview/create-applications/regular-web-apps), go to **Applications > Applications** and click **Create Application**.
2. Give it a name (for example, "Sema4.ai Agents"), choose **Regular Web Applications**, and click **Create**.

Regular Web Applications use the authorization code flow by default, which is what the platform needs.

### Step 2: Configure the callback URL

On the application's **Settings** tab, fill in these four fields, then **Save Changes**:

| Field                 | Value                                          |
| --------------------- | ---------------------------------------------- |
| Allowed Callback URLs | `https://<YOUR_HOSTNAME>/api/v1/auth/callback` |
| Allowed Logout URLs   | `https://<YOUR_HOSTNAME>`                      |
| Application Login URI | `https://<YOUR_HOSTNAME>/login`                |
| Allowed Web Origins   | `https://<YOUR_HOSTNAME>`                      |

The Application Login URI must be `https`, so Auth0 rejects a `localhost` value here.

### Step 3: Capture the credentials

From the **Settings** tab, copy:

- **Client ID** (your **Client ID** → `AS_API_OIDC_CLIENT_ID`).
- **Client Secret** (your **Client Secret** → `AS_API_OIDC_CLIENT_SECRET`).
- **Domain**, which you use to build the Discovery URL in the next step.

On the **Credentials** tab, check that **Authentication Method** is **Client Secret (Post)**, the default for a Regular Web Application.
If it shows another method, select **Client Secret (Post)** and save.

### Step 4: Get the Discovery URL

Your **Discovery URL** (→ `AS_API_OIDC_SERVER`) is your Auth0 domain's OpenID configuration endpoint:

```
https://<YOUR_AUTH0_DOMAIN>/.well-known/openid-configuration
```

For example, `https://your-tenant.us.auth0.com/.well-known/openid-configuration`. See [Auth0's OIDC discovery docs](https://auth0.com/docs/get-started/applications/configure-applications-with-oidc-discovery).

### Step 5: Restrict who can sign in (optional)

Auth0 offers several ways to limit who can access the application: enabling only specific **connections** for this application, using **Organizations**, or adding an **Action** that allows only certain users or groups. Configure this to match your Auth0 setup.

### Step 6: Finalize

You now have the three values from the table at the top of this page:

- **Discovery URL** (`AS_API_OIDC_SERVER`)
- **Client ID** (`AS_API_OIDC_CLIENT_ID`)
- **Client Secret** (`AS_API_OIDC_CLIENT_SECRET`)

Set these on your deployment when you install the application. See [Single sign-on and identity](https://sema4.ai/docs/v3/admin/sso.md) for where they go.
