> ## Documentation Index
> Fetch the complete documentation index at: https://docs.introlink.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Sign-in (OAuth)

> How an MCP client signs a user in to IntroLink: discovery, clients, tokens, revocation.

IntroLink is its own OAuth 2.1 authorization server for `/mcp`, as the
[MCP authorization spec](https://modelcontextprotocol.io/specification/2025-11-25/basic/authorization)
describes. The user signs in to IntroLink itself (with Google, as in the app);
IntroLink never hands an assistant a Google token.

## Discovery

A request to `/mcp` without a token gets:

```http theme={null}
HTTP/1.1 401 Unauthorized
WWW-Authenticate: Bearer resource_metadata="https://app.introlink.ai/.well-known/oauth-protected-resource/mcp", scope="introlink"
```

| Document | What it says |
| - | - |
| `/.well-known/oauth-protected-resource/mcp` (and the root path) | RFC 9728: `resource` is `https://app.introlink.ai/mcp`, `authorization_servers` is `["https://app.introlink.ai"]`, `scopes_supported: ["introlink"]`, `bearer_methods_supported: ["header"]`, `resource_documentation` is [`https://docs.introlink.ai/mcp/overview`](https://docs.introlink.ai/mcp/overview) |
| `/.well-known/oauth-authorization-server` | RFC 8414: the endpoints below (`/oauth/authorize`, `/oauth/token`, `/oauth/register`, `/oauth/revoke`), `response_types_supported: ["code"]`, `response_modes_supported: ["query"]`, `grant_types_supported: ["authorization_code", "refresh_token"]`, `code_challenge_methods_supported: ["S256"]`, `token_endpoint_auth_methods_supported: ["none"]`, `revocation_endpoint_auth_methods_supported: ["none"]`, `client_id_metadata_document_supported: true`, `authorization_response_iss_parameter_supported: true` |

## Clients

Every client is public: PKCE with S256 and no secret.

* **Client ID metadata documents** (preferred, and what Claude and ChatGPT use
  when a server supports them): the `client_id` is an https URL serving the
  client's metadata. IntroLink fetches it (https only, a named host, a path, no
  redirects, at most 20 KB, 5 seconds), checks that its `client_id` is its own
  URL and that the requested `redirect_uri` is listed, and caches it for a day.
* **Dynamic registration** (RFC 7591) at `POST /oauth/register`, for clients
  without a document. It takes one to ten `redirect_uris`, and `grant_types`
  must include `authorization_code`. The answer is a `client_id` (`c_…`) and no
  secret.

A redirect URI must be https, plain http on this machine (`localhost`,
`127.0.0.1` or `[::1]`), or a native app's own scheme (`cursor://…`), with no
fragment. It must match a registered one exactly, except that a loopback
redirect may use any port (RFC 8252).

## The flow

1. `GET /oauth/authorize` with `response_type=code`, `client_id`,
   `redirect_uri`, `code_challenge`, `code_challenge_method=S256`, `state` and
   `resource=https://app.introlink.ai/mcp` (optional; any other resource is
   refused with `invalid_target`). A bad client or redirect is shown to the
   user and nothing is sent back; any other mistake returns `?error=…`.
2. Signed out, the user signs in to IntroLink and comes back.
3. The consent screen names the assistant, the host it is identified by and
   the host the user returns to. **Allow** posts to `/oauth/approve`. An
   assistant that already has a live grant for this user keeps it.
4. The client gets `?code=ilc_…&state=…&iss=https://app.introlink.ai`
   (RFC 9207). An error redirect carries `iss` too.
5. `POST /oauth/token` (form-encoded) with `grant_type=authorization_code`,
   `code`, `redirect_uri`, `client_id`, `code_verifier`.

```json theme={null}
{ "access_token": "ila_…", "token_type": "Bearer", "expires_in": 3600, "refresh_token": "ilr_…", "scope": "introlink" }
```

6. To refresh, `POST /oauth/token` with `grant_type=refresh_token`,
   `refresh_token` and `client_id`. The answer is a new pair, in the same
   shape.

| Token | Lifetime | Rules |
| - | - | - |
| Authorization code | 10 minutes | single use; a second use revokes everything it led to |
| Access token | 1 hour | only for `https://app.introlink.ai/mcp` |
| Refresh token | 30 days | single use, rotated on every refresh; a reuse more than a minute later revokes the grant |

Only SHA-256 hashes of codes and tokens are stored.

## Revoking

* The user: **Settings → Assistants (MCP) → Disconnect**. Every token under
  that assistant's grant stops at its next request.
* The client: `POST /oauth/revoke` (RFC 7009) with `token=…`, an access or a
  refresh token. It revokes the whole grant, every token under it. An unknown
  token is not an error.

A request with a dead token gets `401` with `error="invalid_token"` in the
challenge, and the client starts the sign-in again.

## Transport

Streamable HTTP, stateless: `POST /mcp` with one JSON-RPC message (or a
batch), answered as `application/json`; notifications get `202`. There is no
server-to-client stream (`GET` is `405`) and no session id. Protocol versions
`2025-11-25`, `2025-06-18` and `2025-03-26`.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.