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

# OpenID Connect endpoints

> Every OpenID Connect and OAuth 2.0 endpoint Aiveth serves, with its parameters and answers.

These are the endpoints your apps call to sign people in. The discovery document lists them all, so an OpenID Connect library needs only the issuer address, `https://accounts.aiveth.com`.

## Discovery

```bash Request theme={null}
curl https://accounts.aiveth.com/.well-known/openid-configuration
```

The main fields of the answer:

| Field | Value |
| - | - |
| `issuer` | `https://accounts.aiveth.com` |
| `authorization_endpoint` | `https://accounts.aiveth.com/oauth/authorize` |
| `token_endpoint` | `https://accounts.aiveth.com/oauth/token` |
| `userinfo_endpoint` | `https://accounts.aiveth.com/oauth/userinfo` |
| `revocation_endpoint` | `https://accounts.aiveth.com/oauth/revoke` |
| `end_session_endpoint` | `https://accounts.aiveth.com/oauth/logout` |
| `device_authorization_endpoint` | `https://accounts.aiveth.com/oauth/device_authorization` |
| `jwks_uri` | `https://accounts.aiveth.com/v1/auth/.well-known/jwks.json` |
| `response_types_supported` | `["code"]` |
| `grant_types_supported` | `authorization_code`, `refresh_token`, `client_credentials`, `urn:ietf:params:oauth:grant-type:device_code`, `urn:ietf:params:oauth:grant-type:jwt-bearer`, `urn:ietf:params:oauth:grant-type:token-exchange` |
| `scopes_supported` | `openid`, `email`, `profile`, `roles`, `groups`, `offline_access` |
| `token_endpoint_auth_methods_supported` | `client_secret_basic`, `client_secret_post`, `none` |
| `code_challenge_methods_supported` | `["S256"]` |
| `id_token_signing_alg_values_supported` | `["RS256"]` |
| `subject_types_supported` | `["public"]` |
| `acr_values_supported` | `urn:aiveth:acr:1fa`, `urn:aiveth:acr:2fa` |
| `prompt_values_supported` | `["none", "login"]` |
| `dpop_signing_alg_values_supported` | `["ES256", "RS256"]` |
| `backchannel_logout_supported`, `backchannel_logout_session_supported` | `true` |
| `authorization_response_iss_parameter_supported` | `true` |

On a [custom domain](https://docs.aiveth.com/brand/custom-domains.md), the document names that domain as the issuer and in every endpoint.

## Authorize

```text theme={null}
GET /oauth/authorize
```

Starts a sign-in in the person's browser.

**response\_type** `string` *required*

Must be `code`.

**client\_id** `string` *required*

Your app's client ID.

**redirect\_uri** `string` *required*

One of the app's registered return addresses, matched exactly. A loopback address registered without a port matches on any port.

**scope** `string` *required*

Space-separated. Must include `openid`. Allowed: `openid`, `email`, `profile`, `roles`, `groups`, `offline_access`.

**code\_challenge** `string` *required*

The base64url-encoded SHA-256 of your `code_verifier`.

**code\_challenge\_method** `string` *required*

Must be `S256`.

**state** `string`

Returned unchanged. Use it to stop cross-site request forgery.

**nonce** `string`

Put in the ID token unchanged. Use it to stop replay.

**prompt** `string`

`none` (never show a screen), `login` (prove it's them now). `consent` and `select_account` are accepted. `none` must be alone.

**max\_age** `integer`

The longest time, in seconds, since the person last proved it's them. `0` is the same as `prompt=login`.

**acr\_values** `string`

`urn:aiveth:acr:2fa` to require a second factor proved in this session. Unknown values are ignored.

**Success:** a `302` redirect to `redirect_uri` with `code`, `iss` (RFC 9207) and `state`. The code lasts 2 minutes and works once.

**Errors:** a redirect with `error`, `error_description` and `state`: `unsupported_response_type`, `invalid_scope`, `invalid_request`, `access_denied`, `login_required`, `interaction_required`, `unmet_authentication_requirements`. An unknown app or unregistered return address gets an error page, never a redirect. See [Login with Aiveth](https://docs.aiveth.com/apps/login-with-aiveth.md).

## Token

```text theme={null}
POST /oauth/token
Content-Type: application/x-www-form-urlencoded
```

**App authentication:** a server app sends its client ID and secret with HTTP Basic (`client_secret_basic`) or as `client_id` and `client_secret` in the form (`client_secret_post`). A public app sends only `client_id` and must not send a secret.

**DPoP:** for a person's grant, send a `DPoP` header to get a bound token. See [DPoP](https://docs.aiveth.com/apps/dpop.md).

### Authorization code

| Parameter | |
| - | - |
| `grant_type` | `authorization_code` |
| `code` | The code from the redirect |
| `redirect_uri` | The same `redirect_uri` as in the authorize request |
| `code_verifier` | Your PKCE verifier, 43 to 128 characters of `A-Z a-z 0-9 - . _ ~` |

### Refresh token

| Parameter | |
| - | - |
| `grant_type` | `refresh_token` |
| `refresh_token` | The current refresh token |
| `scope` | Optional. Equal to or narrower than the original. |

### Client credentials (machine apps)

| Parameter | |
| - | - |
| `grant_type` | `client_credentials` |
| `scope` | Optional. App permissions, at most those the app was given. |

See [Machine-to-machine](https://docs.aiveth.com/apps/machine-to-machine.md).

### Device code

| Parameter | |
| - | - |
| `grant_type` | `urn:ietf:params:oauth:grant-type:device_code` |
| `device_code` | From `/oauth/device_authorization` |

See [Device login](https://docs.aiveth.com/apps/device-login.md).

### Other grants

The `jwt-bearer` and `token-exchange` grants serve AI agents, server-to-server calls between your MCP servers, and connected accounts. See [Agent tokens](https://docs.aiveth.com/agents/agent-tokens.md).

### Answer

```json theme={null}
{
  "access_token": "...",
  "token_type": "Bearer",
  "expires_in": 3600,
  "scope": "openid email profile offline_access",
  "id_token": "eyJ...",
  "refresh_token": "..."
}
```

* `token_type` is `DPoP` when the token is bound to a DPoP key.
* `id_token` is present for person grants. A machine token has none.
* `refresh_token` is present only when the scope includes `offline_access`.

Every answer carries `Cache-Control: no-store`. Errors are listed in [Errors and limits](https://docs.aiveth.com/api-reference/errors-and-limits.md).

## Userinfo

```text theme={null}
GET /oauth/userinfo
Authorization: Bearer <access token>
```

For a DPoP-bound token, use `Authorization: DPoP <access token>` with a `DPoP` proof header.

**Success:** `200` with `sub` and the claims for the token's scopes, as in the ID token. See [Tokens and claims](https://docs.aiveth.com/apps/tokens-and-claims.md).

**Error:** `401`, `{"error": "invalid_token"}`, with a `WWW-Authenticate` header. The token is unknown, expired, ended, or presented with the wrong scheme.

## JWKS

```text theme={null}
GET /v1/auth/.well-known/jwks.json
```

Aiveth's public signing keys as a JSON Web Key Set. Use them to verify ID tokens, machine tokens, logout tokens and other JWTs Aiveth signs. Cache the set, and fetch it again when a token names a key ID you don't have.

## Revoke

```text theme={null}
POST /oauth/revoke
Content-Type: application/x-www-form-urlencoded
```

| Parameter | |
| - | - |
| `token` | The refresh token or access token to end |

Authenticate the app as at the token endpoint. An app can end only its own tokens.

**Answer:** always `200` with `{}`, whether or not there was anything to end (RFC 7009). A wrong app or secret gets `401` `invalid_client`. Ending a refresh token ends the whole sign-in.

## Logout

```text theme={null}
GET  /oauth/logout
POST /oauth/logout
```

| Parameter | |
| - | - |
| `id_token_hint` | An ID token issued to your app for this person (expired is fine) |
| `client_id` | Your client ID; must match the hint's `aud` |
| `post_logout_redirect_uri` | One of the app's registered sign-out addresses |
| `state` | Returned on the redirect |

With a valid hint for this session, the person is signed out at once and redirected with `303`. Without one, Aiveth asks the person first. See [Logout](https://docs.aiveth.com/apps/logout.md).

## Device authorization

```text theme={null}
POST /oauth/device_authorization
Content-Type: application/x-www-form-urlencoded
```

| Parameter | |
| - | - |
| `client_id` | Your client ID (and secret, for a server app) |
| `scope` | Must include `openid`. Defaults to `openid`. |

**Answer:** `device_code`, `user_code`, `verification_uri`, `verification_uri_complete`, `expires_in` (300) and `interval` (5). Device login must be turned on for the app, or the answer is `unauthorized_client`. See [Device login](https://docs.aiveth.com/apps/device-login.md).

## Introspect

```text theme={null}
POST /oauth/introspect
Content-Type: application/x-www-form-urlencoded
```

| Parameter | |
| - | - |
| `token` | An AI agent's access token |

For AI agent tokens only (RFC 7662). The answer is `{"active": false}` for any token Aiveth wouldn't issue again now: bad or expired, an agent stopped or paused, a person who can no longer sign in. An active answer has `active`, `token_type` and the token's `sub`, `client_id`, `scope`, `aud`, `iss`, `exp`, `iat`, `org_id`, and `act` when present. See [Agent tokens](https://docs.aiveth.com/agents/agent-tokens.md).

App access tokens are opaque; check them at userinfo instead.

## Browser calls

Single-page apps may call the token, userinfo and revoke endpoints, the discovery document and the JWKS from a registered web origin. See [Single-page apps](https://docs.aiveth.com/apps/single-page-apps.md).

## Related

* [Login with Aiveth](https://docs.aiveth.com/apps/login-with-aiveth.md)
* [Tokens and claims](https://docs.aiveth.com/apps/tokens-and-claims.md)
* [Errors and limits](https://docs.aiveth.com/api-reference/errors-and-limits.md)


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