# Auth0 Integration

Connect Auth0 as an identity provider so your users can sign in to AccessIQ with their Auth0-managed credentials.

## Prerequisites

* An Auth0 account with permission to create applications
* AccessIQ tenant with admin access

## Step 1: Create an Application in Auth0

1. Sign in to the [Auth0 Dashboard](https://manage.auth0.com).
2. Go to **Applications > Applications**.
3. Click **Create Application**.
4. Name it `AccessIQ` and select **Regular Web Applications**.
5. Click **Create**.

## Step 2: Configure Application Settings

Go to the **Settings** tab and update the following:

| Field                 | Value                                                        |
| --------------------- | ------------------------------------------------------------ |
| Allowed Callback URLs | `https://<your-tenant>.accessiq.app/api/auth/callback/auth0` |
| Allowed Logout URLs   | `https://<your-tenant>.accessiq.app`                         |
| Allowed Web Origins   | `https://<your-tenant>.accessiq.app`                         |

Scroll down and click **Save Changes**.

## Step 3: Collect Your Auth0 Credentials

From the same **Settings** tab, copy these values:

| Credential        | Where to find it                                             |
| ----------------- | ------------------------------------------------------------ |
| **Client ID**     | Settings > Basic Information                                 |
| **Client Secret** | Settings > Basic Information                                 |
| **Domain**        | Settings > Basic Information (e.g., `yourcompany.auth0.com`) |
| **Issuer URL**    | `https://<your-auth0-domain>/`                               |

## Step 4: Add Auth0 as a Provider in AccessIQ

1. In AccessIQ, go to **Identity > Providers**.
2. Click **Add Provider** and select **Auth0**.
3. Enter the **Client ID**, **Client Secret**, and **Issuer URL**.
4. Click **Save**.

## Step 5: Test the Connection

1. Open your AccessIQ login page in a private browser window.
2. Click **Sign in with Auth0**.
3. Authenticate and confirm you reach the AccessIQ dashboard.

## Troubleshooting

| Issue                        | Solution                                                                             |
| ---------------------------- | ------------------------------------------------------------------------------------ |
| Callback URL mismatch        | Verify the Allowed Callback URL in Auth0 matches the redirect URI shown in AccessIQ  |
| Consent screen not appearing | Check the Auth0 application's "Prompt" setting under Advanced                        |
| User attributes missing      | Ensure the Auth0 application has the `openid`, `profile`, and `email` scopes enabled |


---

# 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://accessiq.gitbook.io/accessiq-docs/identity-and-single-sign-on/auth0.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.
