> For the complete documentation index, see [llms.txt](https://docs.octoxlabs.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.octoxlabs.com/adapters/a/auth0.md).

# Auth0

Auth0 is a cloud identity platform. OctoXLabs reads the users of a tenant through the Management API, together with the group membership of each user.

## Use cases

* Find Auth0 accounts that have no match in your directory.

```
Adapters = auth0 AND NOT Adapters = active-directory
```

* Check what one Auth0 connection collected.

```
Connections = YOUR_CONNECTION_NAME
```

## Before you begin

### Network

| Source              | Destination                                                                  | Port | Protocol |
| ------------------- | ---------------------------------------------------------------------------- | ---- | -------- |
| OctoXLabs connector | Your Auth0 tenant, for example your-tenant.us.auth0.com (or a custom domain) | 443  | HTTPS    |

### Required permissions

| Scope or role                | Permission | Needed for                    |
| ---------------------------- | ---------- | ----------------------------- |
| read:users (Management API)  | Read       | Listing users                 |
| read:groups (Management API) | Read       | Group membership of each user |

The Machine-to-Machine application must be authorized for the Auth0 Management API with both scopes.

## Create credentials in Auth0

{% stepper %}
{% step %}

### Create the application

In the Auth0 Dashboard, open **Applications** > **Applications** and create a **Machine to Machine** application, or reuse an existing one. See [Register Machine-to-Machine Applications](https://auth0.com/docs/get-started/auth0-overview/create-applications/machine-to-machine-apps).
{% endstep %}

{% step %}

### Authorize it

Authorize the application for the **Auth0 Management API** and grant the `read:users` and `read:groups` scopes.
{% endstep %}

{% step %}

### Copy the credentials

Copy the Client ID and the Client Secret from the Settings tab of the application.
{% endstep %}
{% endstepper %}

{% hint style="info" %}
Plan **free** pages through the users endpoint. Auth0 limits it to about 1000 users, and extra users are not collected (a warning is logged). Plan **enterprise** uses the bulk user export job, which has no 1000 user limit but needs a plan that allows user export jobs.
{% endhint %}

## Connection parameters

| Parameter     | Required | Type    | Default | Description                                                                             |
| ------------- | -------- | ------- | ------- | --------------------------------------------------------------------------------------- |
| Domain        | Yes      | String  | None    | Tenant domain such as `tenant.region.auth0.com`, or a custom domain. No scheme or path. |
| Client ID     | Yes      | String  | None    | Client ID of the M2M application.                                                       |
| Client Secret | Yes      | String  | None    | Client Secret of the same application.                                                  |
| Plan          | No       | Choice  | free    | `free` pages through the users endpoint. `enterprise` uses the bulk export job.         |
| Proxy         | No       | String  | None    | Proxy address. The connector sends requests through `http://<value>`.                   |
| Thread Count  | No       | Integer | 32      | Parallel threads used to read group membership. Minimum 1, maximum 32.                  |
| Sleep Time    | No       | Integer | 0       | Delay in seconds between starting threads.                                              |
| Timeout       | No       | Integer | 30      | Time in seconds to wait for API responses.                                              |

## Troubleshooting

| Error message                                                          | Cause                                                                  | Fix                                                                                                                                           |
| ---------------------------------------------------------------------- | ---------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------- |
| Max retries exceeded for                                               | Auth0 answered 401 or 429 five times in a row.                         | Check the credentials and wait for the rate limit to reset.                                                                                   |
| Auth0 export job failed:                                               | The export job returned status failed.                                 | Read the details. Switch Plan to free if the tenant does not allow export jobs.                                                               |
| Auth0 export job did not complete in time                              | The export job did not finish within 60 polls of 5 seconds.            | Retry later or use Plan free.                                                                                                                 |
| Status Code: `, followed by the URL, the method and the response body` | The API answered with a status other than the one the adapter expects. | Read the code and body. 401 or 403 usually points to wrong credentials or missing permissions. Check the address, port and Is Secure setting. |

## Change history

{% hint style="info" %}
Available starting from version 6.9.1.
{% endhint %}
