> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://docs.mitu.ai/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://docs.mitu.ai/_mcp/server.

# OAuth

OAuth allows your customers to connect their AI apps to your business using the account they already have with you. A customer adds your MCP address to their AI app and is sent to your own sign in page, exactly as they would be on your website. Once they have signed in, every request their agent makes reaches your API carrying that customer's own access token, so the identity, permissions and account rules you already maintain apply to agents without change.

Because your identity provider remains the single source of identity, there is no new credential to issue, deliver or revoke. OAuth works alongside [customer keys](/platform/your-agent-service/integration/authentication/customer-keys) rather than replacing them, so customers you onboard through the API can continue to connect with a key.

## What OAuth provides

1. **A familiar sign in**\
   Customers connect using the sign in page, credentials and security measures they already know, including any multi factor authentication your provider enforces.
2. **One identity across every channel**\
   The account a customer uses in your app is the same account their agent acts for, so their history, entitlements and preferences carry across.
3. **Your authorisation, unchanged**\
   Your API validates the customer's token as it would for any client, and your existing rules decide what the customer may do.

## Before you begin

You need an identity provider that supports OAuth 2.0, such as Okta or Auth0, a [custom MCP domain](/platform/your-agent-service/domains) that is verified, and access to the **Integration** and **Secrets** pages in the [Mitu dashboard](https://app.mitu.ai).

## Configuring OAuth

#### Connect your own domain

The address your identity provider returns customers to after they sign in is built from your custom MCP domain, so [connect your domain](/platform/your-agent-service/domains) first. Once it is verified, the dashboard shows the redirect URI you need in the next step.

#### Register Mitu with your identity provider

In your identity provider, register Mitu as a new application and enter the redirect URI shown in the dashboard. Your provider then issues a client ID and a client secret for Mitu.

#### Store the client secret

Add the client secret under **Secrets**. It is encrypted when stored and never displayed again, and you select it by name when you configure OAuth, so the value itself never appears in your settings.

#### Enter your provider's details

Under **Integration**, choose **Your OAuth** and complete each setting from the details your provider issued. The [settings reference](#settings-reference) describes every one.

#### Accept the customer's token in your API

Every request made on behalf of a signed in customer carries their access token in the Authorization header, together with the Mitu signature and the customer's details.

```http
POST /orders
authorization: Bearer eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9...
x-mitu-signature: t=1788990420,v1=5257a869e7ec...
x-mitu-request-id: req_5f13b916
x-mitu-customer-id: cus_0t9549fps3xd
```

[Verify the request](/platform/security/request-verification) to confirm it came through Mitu, then validate the token as you would for any other client of your API. Your existing authorisation decides what the customer may do.

#### Test the sign in

Add your MCP address to an AI app that supports MCP and connect to it. You should be taken to your own sign in page, returned to the app once you have signed in, and able to complete a task that reaches your API as that customer.

## Settings reference

| Setting                       | Description                                                                                                                                                                                                                                                                                            |
| ----------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| Authorize URL                 | Your provider's authorization endpoint, to which customers are sent to sign in. For example, [https://auth.yourcompany.com/authorize](https://auth.yourcompany.com/authorize).                                                                                                                         |
| Token URL                     | Your provider's token endpoint, at which the sign in is exchanged for an access token. For example, [https://auth.yourcompany.com/oauth/token](https://auth.yourcompany.com/oauth/token).                                                                                                              |
| Client ID                     | The client ID your provider issued when you registered Mitu as an application.                                                                                                                                                                                                                         |
| Client secret                 | The client secret your provider issued, stored under **Secrets** and selected here by name.                                                                                                                                                                                                            |
| Userinfo URL                  | Your provider's userinfo endpoint, used to identify which of your customers a token belongs to. Without it, a sign in can be confirmed but the customer cannot be identified.                                                                                                                          |
| Scopes                        | The scopes requested at sign in, separated by spaces. Include openid, and include offline_access so your provider issues a refresh token. Without offline_access, customers are asked to sign in again every hour.                                                                                     |
| Audience                      | Required for Auth0 only. The identifier of your API in Auth0, such as [https://api.yourcompany.com](https://api.yourcompany.com). Without it, Auth0 issues a token your API will not accept.                                                                                                           |
| Token endpoint authentication | How the client ID and secret are presented to your token endpoint, either in the Authorization header using Basic authentication or in the request body. Okta expects the header by default, and Auth0 accepts either. A mismatch causes the token endpoint to reject the request without explanation. |
| Redirect URI                  | Shown in the dashboard once your custom MCP domain is verified, and entered in your provider when you register Mitu.                                                                                                                                                                                   |

While customers sign in with OAuth, the other options under **Requests from Mitu** in your [integration](/platform/your-agent-service/integration/overview) are disabled, because the Authorization header carries the customer's own token. The Mitu signature continues to prove that each request came from Mitu.

## Security considerations

1. **Validate every token**\
   Check the token's signature, issuer, audience and expiry in your API, exactly as you do for tokens from your own applications.
2. **Keep the client secret in Secrets only**\
   Never place it in code, configuration files or tickets. If it is exposed, issue a new one in your provider and update it under **Secrets**.
3. **Request only the scopes you need**\
   Agents act with the access the customer granted at sign in, so limit scopes to what your tools genuinely require.

With OAuth in place, your customers bring their agents to your business without creating anything new. Every action their agents take is carried out under the account they already hold with you, governed by the identity provider and authorisation rules you already trust.