---
title: "OpenID Connect"
description: "The protocol a relying party speaks to sign an agent in: discovery, keys, authorization, the code exchange and userinfo. Served on the issuer's own host, to any OpenID Connect client."
url: https://doorman.fyi/docs/reference/openid-connect
markdown: https://doorman.fyi/docs/reference/openid-connect.md
area: "API reference"
section: "API reference"
---

# OpenID Connect

The protocol a relying party speaks to sign an agent in: discovery, keys, authorization, the code exchange and userinfo. Served on the issuer's own host, to any OpenID Connect client.

Source: https://doorman.fyi/docs/reference/openid-connect

## Discover the provider

`GET /.well-known/openid-configuration`

Access `public`: no credential.

OpenID Connect discovery: the issuer, its endpoints and what it supports. Cacheable for 300 seconds.

Sign in with Doorman protocol operation, served on the issuer `https://id.doorman.example` and on no other host. It takes no API key, app token, console session or cookie. See [Sign in with Doorman](https://doorman.fyi/docs/sign-in.md).

Part of Sign in with Doorman, which a deployment switches on. Where it is off this route answers `404 not_found`, and `features.signIn` of `GET /v1/me` is false.

Answers `200`: The provider's metadata.

**Response 200: SignInDiscovery**
OpenID Connect discovery for Sign in with Doorman.
- `issuer` (string)
- `authorization_endpoint` (string)
- `token_endpoint` (string)
- `userinfo_endpoint` (string)
- `jwks_uri` (string)
- `response_types_supported` ("code"[])
- `response_modes_supported` ("query"[])
- `grant_types_supported` ("authorization_code"[])
- `subject_types_supported` ("public"[])
- `id_token_signing_alg_values_supported` ("ES256"[])
- `scopes_supported` (("openid" | "email" | "profile" | "owner_profile" | "owner_email")[])
- `claims_supported` (("sub" | "actor_type" | "email" | "email_verified" | "name" | "owner_sub" | "owner_name" | "owner_email" | "owner_email_verified" | "iss" | "aud" | "iat" | "exp" | "auth_time" | "jti" | "nonce")[])
- `token_endpoint_auth_methods_supported` (("client_secret_basic" | "client_secret_post" | "none")[])
- `code_challenge_methods_supported` ("S256"[])
- `authorization_response_iss_parameter_supported` (true)
- `client_id_metadata_document_supported` (true)
- `request_parameter_supported` (false)
- `request_uri_parameter_supported` (false)
- `claims_parameter_supported` (false)

Example 200 response:
```json
{
  "issuer": "https://id.doorman.example",
  "authorization_endpoint": "https://id.doorman.example/sign-in/authorize",
  "token_endpoint": "https://id.doorman.example/sign-in/token",
  "userinfo_endpoint": "https://id.doorman.example/sign-in/userinfo",
  "jwks_uri": "https://id.doorman.example/sign-in/jwks.json",
  "response_types_supported": [
    "code"
  ],
  "response_modes_supported": [
    "query"
  ],
  "grant_types_supported": [
    "authorization_code"
  ],
  "subject_types_supported": [
    "public"
  ],
  "id_token_signing_alg_values_supported": [
    "ES256"
  ],
  "scopes_supported": [
    "openid",
    "email",
    "profile",
    "owner_profile",
    "owner_email"
  ],
  "claims_supported": [
    "sub",
    "actor_type",
    "email",
    "email_verified",
    "name",
    "owner_sub",
    "owner_name",
    "owner_email",
    "owner_email_verified",
    "iss",
    "aud",
    "iat",
    "exp",
    "auth_time",
    "jti",
    "nonce"
  ],
  "token_endpoint_auth_methods_supported": [
    "client_secret_basic",
    "client_secret_post",
    "none"
  ],
  "code_challenge_methods_supported": [
    "S256"
  ],
  "authorization_response_iss_parameter_supported": true,
  "client_id_metadata_document_supported": true,
  "request_parameter_supported": false,
  "request_uri_parameter_supported": false,
  "claims_parameter_supported": false
}
```

**Errors**

| Status | Error | Meaning |
| --- | --- | --- |
| 404 | `not_found` | No such resource for this caller, or no such route. |
| 500 | `internal_error` | Something went wrong on the server. |

curl:
```sh
curl -s "https://id.doorman.example/.well-known/openid-configuration"
```

TypeScript:
```ts
const response = await fetch("https://id.doorman.example/.well-known/openid-configuration", {
  headers: {
  },
  redirect: "manual", credentials: "omit",
});
if (!response.ok) throw new Error(`The API answered ${response.status}.`);
const result = await response.json();
```

Python:
```python
import requests

response = requests.get(
    "https://id.doorman.example/.well-known/openid-configuration",
    headers={},
    allow_redirects=False, timeout=30,
)
response.raise_for_status()
result = response.json()
```

## Read the signing keys

`GET /sign-in/jwks.json`

Access `public`: no credential.

The public keys id tokens are signed with, as a JSON Web Key Set. A new key is published before it signs, and an old one stays until every token it signed has expired. Cacheable for 300 seconds; read it again on a `kid` it does not list.

Sign in with Doorman protocol operation, served on the issuer `https://id.doorman.example` and on no other host. It takes no API key, app token, console session or cookie. See [Sign in with Doorman](https://doorman.fyi/docs/sign-in.md).

Part of Sign in with Doorman, which a deployment switches on. Where it is off this route answers `404 not_found`, and `features.signIn` of `GET /v1/me` is false.

Answers `200`: The keys.

**Response 200: SignInJwks**
The provider's public signing keys. A key is published before it signs and stays published until every token it signed has expired.
- `keys` (SignInJwk[])

**Errors**

| Status | Error | Meaning |
| --- | --- | --- |
| 404 | `not_found` | No such resource for this caller, or no such route. |
| 500 | `internal_error` | Something went wrong on the server. |

curl:
```sh
curl -s "https://id.doorman.example/sign-in/jwks.json"
```

TypeScript:
```ts
const response = await fetch("https://id.doorman.example/sign-in/jwks.json", {
  headers: {
  },
  redirect: "manual", credentials: "omit",
});
if (!response.ok) throw new Error(`The API answered ${response.status}.`);
const result = await response.json();
```

Python:
```python
import requests

response = requests.get(
    "https://id.doorman.example/sign-in/jwks.json",
    headers={},
    allow_redirects=False, timeout=30,
)
response.raise_for_status()
result = response.json()
```

## Begin a sign-in

`GET /sign-in/authorize`

Access `public`: no credential.

Checks the relying party, its redirect and the request, keeps the request for 15 minutes and sends the browser to the page that finishes it. A relying party named by the URL of its identity document has that document read and checked first. A request whose relying party or redirect cannot be trusted is answered here and never redirected. Every later refusal goes back to the redirect with `error`, `state` and `iss`. Parameters this provider does not read are ignored, except `request`, `request_uri` and `registration`, which are refused by name.

Sign in with Doorman protocol operation, served on the issuer `https://id.doorman.example` and on no other host. It takes no API key, app token, console session or cookie. See [Sign in with Doorman](https://doorman.fyi/docs/sign-in.md).

Part of Sign in with Doorman, which a deployment switches on. Where it is off this route answers `404 not_found`, and `features.signIn` of `GET /v1/me` is false.

**Parameters**

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `response_type` | query | `"code"` | yes | Always `code`. |
| `client_id` | query | `string \| string` | yes | The relying party: an id this API issued, or the URL of the identity document it published. Example: `sic_01jc5f1a2b3c4d5e6f7g8h9j0k`. |
| `redirect_uri` | query | `string` | yes | A redirect the relying party registered, on its own host. Compared exactly, except the port of a redirect on the developer's own machine. |
| `scope` | query | `string` | no | Space-separated. `openid` is required when any is named; scopes this provider does not have are ignored. When omitted, `openid email`. |
| `state` | query | `string` | no | An opaque value returned unchanged with the answer. |
| `nonce` | query | `string` | no | An opaque value returned unchanged in the id token. |
| `code_challenge` | query | `string` | no | The S256 PKCE challenge of the verifier the relying party keeps. Required of a public relying party. |
| `code_challenge_method` | query | `"S256"` | no | Always `S256`. |
| `login_hint` | query | `string` | no | The address the relying party expects, as it was handed one when a sign-in link started the login. A hint, never a decision. |
| `prompt` | query | `string` | no | `none` asks for an answer without interaction: where the owner would have to decide, the answer is `login_required`. Other values are ignored. |

Answers `303`: Continue in the browser, or go back to the redirect with an error.

Response header `Location`: The page that finishes the sign-in, or the relying party's redirect.

Answers `400`: The relying party or its redirect could not be trusted, so nothing is redirected.

**Response 400: SignInProtocolError**
A protocol error, distinct from the Inbox API's error envelope: the code, and a fixed sentence when one helps. The sentence is written by the provider and never carries text from the request.
- `error` ("invalid_request" | "invalid_client" | "invalid_grant" | "invalid_scope" | "unauthorized_client" | "unsupported_grant_type" | "unsupported_response_type" | "access_denied" | "login_required" | "interaction_required" | "request_not_supported" | "request_uri_not_supported" | "registration_not_supported" | "invalid_token" | "invalid_client_metadata" | "temporarily_unavailable" | "server_error")
- `error_description` (string, optional)

Example 400 response:
```json
{
  "error": "invalid_grant"
}
```

Answers `429`: Too many requests. Try again after the time `Retry-After` gives.

**Response 429: SignInProtocolError**
A protocol error, distinct from the Inbox API's error envelope: the code, and a fixed sentence when one helps. The sentence is written by the provider and never carries text from the request.
- `error` ("invalid_request" | "invalid_client" | "invalid_grant" | "invalid_scope" | "unauthorized_client" | "unsupported_grant_type" | "unsupported_response_type" | "access_denied" | "login_required" | "interaction_required" | "request_not_supported" | "request_uri_not_supported" | "registration_not_supported" | "invalid_token" | "invalid_client_metadata" | "temporarily_unavailable" | "server_error")
- `error_description` (string, optional)

Example 429 response:
```json
{
  "error": "invalid_grant"
}
```

**Errors**

| Status | Error | Meaning |
| --- | --- | --- |
| 404 | `not_found` | No such resource for this caller, or no such route. |
| 500 | `internal_error` | Something went wrong on the server. |

Build the authorization URL with a fresh `state`, a `nonce` and an S256 challenge, then navigate the browser there. Any OpenID Connect client does this from the issuer alone. Do not fetch this route from a server: the answer is a redirect for the browser that will hold the session. See [the sign-in a service runs](https://doorman.fyi/docs/sign-in.md#flow).

## Exchange a code

`POST /sign-in/token`

Access `public`: no credential.

Exchanges a code, once, within 60 seconds of its issue, for an id token and an access token that last 10 minutes. A relying party with a secret presents it with HTTP Basic or in the body, whichever it registered, and is refused the other way (401 `invalid_client`); a public one sends its PKCE verifier. The inbox, its account and the owner's decision are read again, so a code issued before the owner stopped the address is refused. A code presented twice ends the tokens its first exchange returned. There is no refresh token.

Sign in with Doorman protocol operation, served on the issuer `https://id.doorman.example` and on no other host. It takes no API key, app token, console session or cookie. See [Sign in with Doorman](https://doorman.fyi/docs/sign-in.md).

Part of Sign in with Doorman, which a deployment switches on. Where it is off this route answers `404 not_found`, and `features.signIn` of `GET /v1/me` is false.

**Request body (application/x-www-form-urlencoded): SignInTokenRequest**
A form-encoded code exchange. A relying party with a secret sends it with HTTP Basic or in the body; a public one sends the PKCE verifier. Other fields are ignored.
- `grant_type` ("authorization_code")
- `code` (string)
- `redirect_uri` (string)
- `client_id` (string, optional)
- `client_secret` (string, optional)
- `code_verifier` (string, optional)

Answers `200`: The id token and the access token.

**Response 200: SignInTokens**
The id token, and an access token for the userinfo endpoint. There is no refresh token: a longer session is the relying party's own.
- `access_token` (string)
- `token_type` ("Bearer")
- `expires_in` (integer)
- `id_token` (string): An ES256 JWT. Check its signature against the published keys, and its `iss`, `aud`, `exp` and `nonce`.
- `scope` (string): What was granted, which may be less than was asked: who owns the agent is told only where the owner allowed it.

Answers `400`: The request or the code was refused.

**Response 400: SignInProtocolError**
A protocol error, distinct from the Inbox API's error envelope: the code, and a fixed sentence when one helps. The sentence is written by the provider and never carries text from the request.
- `error` ("invalid_request" | "invalid_client" | "invalid_grant" | "invalid_scope" | "unauthorized_client" | "unsupported_grant_type" | "unsupported_response_type" | "access_denied" | "login_required" | "interaction_required" | "request_not_supported" | "request_uri_not_supported" | "registration_not_supported" | "invalid_token" | "invalid_client_metadata" | "temporarily_unavailable" | "server_error")
- `error_description` (string, optional)

Example 400 response:
```json
{
  "error": "invalid_grant"
}
```

Answers `401`: The relying party could not be authenticated.

**Response 401: SignInProtocolError**
A protocol error, distinct from the Inbox API's error envelope: the code, and a fixed sentence when one helps. The sentence is written by the provider and never carries text from the request.
- `error` ("invalid_request" | "invalid_client" | "invalid_grant" | "invalid_scope" | "unauthorized_client" | "unsupported_grant_type" | "unsupported_response_type" | "access_denied" | "login_required" | "interaction_required" | "request_not_supported" | "request_uri_not_supported" | "registration_not_supported" | "invalid_token" | "invalid_client_metadata" | "temporarily_unavailable" | "server_error")
- `error_description` (string, optional)

Example 401 response:
```json
{
  "error": "invalid_grant"
}
```

Answers `429`: Too many requests. Try again after the time `Retry-After` gives.

**Response 429: SignInProtocolError**
A protocol error, distinct from the Inbox API's error envelope: the code, and a fixed sentence when one helps. The sentence is written by the provider and never carries text from the request.
- `error` ("invalid_request" | "invalid_client" | "invalid_grant" | "invalid_scope" | "unauthorized_client" | "unsupported_grant_type" | "unsupported_response_type" | "access_denied" | "login_required" | "interaction_required" | "request_not_supported" | "request_uri_not_supported" | "registration_not_supported" | "invalid_token" | "invalid_client_metadata" | "temporarily_unavailable" | "server_error")
- `error_description` (string, optional)

Example 429 response:
```json
{
  "error": "invalid_grant"
}
```

**Errors**

| Status | Error | Meaning |
| --- | --- | --- |
| 404 | `not_found` | No such resource for this caller, or no such route. |
| 500 | `internal_error` | Something went wrong on the server. |

curl:
```sh
curl -s -X POST "https://id.doorman.example/sign-in/token" \
  --data-urlencode 'grant_type=authorization_code' \
  --data-urlencode 'code=replace-with-the-code-from-the-callback' \
  --data-urlencode 'redirect_uri=https://app.example.net/auth/callback'
```

TypeScript:
```ts
const response = await fetch("https://id.doorman.example/sign-in/token", {
  method: "POST",
  headers: {
    "content-type": "application/x-www-form-urlencoded",
  },
  redirect: "manual", credentials: "omit",
  body: new URLSearchParams({
    "grant_type": "authorization_code",
    "code": "replace-with-the-code-from-the-callback",
    "redirect_uri": "https://app.example.net/auth/callback"
  }),
});
if (!response.ok) throw new Error(`The API answered ${response.status}.`);
const result = await response.json();
```

Python:
```python
import requests

response = requests.post(
    "https://id.doorman.example/sign-in/token",
    headers={},
    data={
        "grant_type": "authorization_code",
        "code": "replace-with-the-code-from-the-callback",
        "redirect_uri": "https://app.example.net/auth/callback",
    },
    allow_redirects=False, timeout=30,
)
response.raise_for_status()
result = response.json()
```

## Read the signed-in address

`GET /sign-in/userinfo`

Access `sign_in`: the access token a relying party was issued with a sign-in, presented to the issuer; no API key, app token or console session is accepted.

The claims about the address an access token was issued for, read again from live state: the address, its name and, where the owner allows it now, who owns it. Authenticated with the access token of the code exchange, never with an API credential. An address that was deleted or stopped since answers 401.

Sign in with Doorman protocol operation, served on the issuer `https://id.doorman.example` and on no other host. It takes no API key, app token, console session or cookie. See [Sign in with Doorman](https://doorman.fyi/docs/sign-in.md).

Part of Sign in with Doorman, which a deployment switches on. Where it is off this route answers `404 not_found`, and `features.signIn` of `GET /v1/me` is false.

Answers `200`: The claims the granted scopes allow, as they are now.

**Response 200: SignInUserInfo**
The claims about the signed-in address, read again from live state on every call.
- `sub` (string): The address's subject: the same at every relying party, and a new one if the address is ever given up and issued again. Example: `f0Jx2kQp9wLr7TzV3mYb8nHc5dGs1aKe4uWq6oPi0Ag`
- `actor_type` ("agent"): Always `agent`: the one signing in is software acting for its owner.
- `email` (string, optional): `email`: the address. Example: `concierge@doorman.example`
- `email_verified` (true, optional)
- `name` (string, optional): `profile`: the address's display name, when it has one.
- `owner_sub` (string, optional): `profile`: who owns the agent, as an identifier that is different at every relying party.
- `owner_name` (string, optional): `owner_profile`, where the owner allowed it: the owner's name.
- `owner_email` (string, optional): `owner_email`, where the owner allowed it: the owner's own address.
- `owner_email_verified` (true, optional)

Example 200 response:
```json
{
  "sub": "f0Jx2kQp9wLr7TzV3mYb8nHc5dGs1aKe4uWq6oPi0Ag",
  "actor_type": "agent",
  "email": "concierge@doorman.example",
  "email_verified": true
}
```

Answers `401`: The access token is missing, unknown, expired or ended.

**Response 401: SignInProtocolError**
A protocol error, distinct from the Inbox API's error envelope: the code, and a fixed sentence when one helps. The sentence is written by the provider and never carries text from the request.
- `error` ("invalid_request" | "invalid_client" | "invalid_grant" | "invalid_scope" | "unauthorized_client" | "unsupported_grant_type" | "unsupported_response_type" | "access_denied" | "login_required" | "interaction_required" | "request_not_supported" | "request_uri_not_supported" | "registration_not_supported" | "invalid_token" | "invalid_client_metadata" | "temporarily_unavailable" | "server_error")
- `error_description` (string, optional)

Example 401 response:
```json
{
  "error": "invalid_grant"
}
```

Response header `WWW-Authenticate`: `Bearer error="invalid_token"`.

Answers `429`: Too many requests. Try again after the time `Retry-After` gives.

**Response 429: SignInProtocolError**
A protocol error, distinct from the Inbox API's error envelope: the code, and a fixed sentence when one helps. The sentence is written by the provider and never carries text from the request.
- `error` ("invalid_request" | "invalid_client" | "invalid_grant" | "invalid_scope" | "unauthorized_client" | "unsupported_grant_type" | "unsupported_response_type" | "access_denied" | "login_required" | "interaction_required" | "request_not_supported" | "request_uri_not_supported" | "registration_not_supported" | "invalid_token" | "invalid_client_metadata" | "temporarily_unavailable" | "server_error")
- `error_description` (string, optional)

Example 429 response:
```json
{
  "error": "invalid_grant"
}
```

**Errors**

| Status | Error | Meaning |
| --- | --- | --- |
| 404 | `not_found` | No such resource for this caller, or no such route. |
| 500 | `internal_error` | Something went wrong on the server. |

curl:
```sh
curl -s "https://id.doorman.example/sign-in/userinfo" \
  -H "authorization: Bearer dst_..."
```

TypeScript:
```ts
const response = await fetch("https://id.doorman.example/sign-in/userinfo", {
  headers: {
    "authorization": "Bearer dst_...",
  },
  redirect: "manual", credentials: "omit",
});
if (!response.ok) throw new Error(`The API answered ${response.status}.`);
const result = await response.json();
```

Python:
```python
import requests

response = requests.get(
    "https://id.doorman.example/sign-in/userinfo",
    headers={"authorization": "Bearer dst_..."},
    allow_redirects=False, timeout=30,
)
response.raise_for_status()
result = response.json()
```

## Read the signed-in address with POST

`POST /sign-in/userinfo`

Access `sign_in`: the access token a relying party was issued with a sign-in, presented to the issuer; no API key, app token or console session is accepted.

The same answer as the GET, for OpenID Connect clients that send POST. The access token goes in the Authorization header.

Sign in with Doorman protocol operation, served on the issuer `https://id.doorman.example` and on no other host. It takes no API key, app token, console session or cookie. See [Sign in with Doorman](https://doorman.fyi/docs/sign-in.md).

Part of Sign in with Doorman, which a deployment switches on. Where it is off this route answers `404 not_found`, and `features.signIn` of `GET /v1/me` is false.

Answers `200`: The claims the granted scopes allow, as they are now.

**Response 200: SignInUserInfo**
The claims about the signed-in address, read again from live state on every call.
- `sub` (string): The address's subject: the same at every relying party, and a new one if the address is ever given up and issued again. Example: `f0Jx2kQp9wLr7TzV3mYb8nHc5dGs1aKe4uWq6oPi0Ag`
- `actor_type` ("agent"): Always `agent`: the one signing in is software acting for its owner.
- `email` (string, optional): `email`: the address. Example: `concierge@doorman.example`
- `email_verified` (true, optional)
- `name` (string, optional): `profile`: the address's display name, when it has one.
- `owner_sub` (string, optional): `profile`: who owns the agent, as an identifier that is different at every relying party.
- `owner_name` (string, optional): `owner_profile`, where the owner allowed it: the owner's name.
- `owner_email` (string, optional): `owner_email`, where the owner allowed it: the owner's own address.
- `owner_email_verified` (true, optional)

Example 200 response:
```json
{
  "sub": "f0Jx2kQp9wLr7TzV3mYb8nHc5dGs1aKe4uWq6oPi0Ag",
  "actor_type": "agent",
  "email": "concierge@doorman.example",
  "email_verified": true
}
```

Answers `401`: The access token is missing, unknown, expired or ended.

**Response 401: SignInProtocolError**
A protocol error, distinct from the Inbox API's error envelope: the code, and a fixed sentence when one helps. The sentence is written by the provider and never carries text from the request.
- `error` ("invalid_request" | "invalid_client" | "invalid_grant" | "invalid_scope" | "unauthorized_client" | "unsupported_grant_type" | "unsupported_response_type" | "access_denied" | "login_required" | "interaction_required" | "request_not_supported" | "request_uri_not_supported" | "registration_not_supported" | "invalid_token" | "invalid_client_metadata" | "temporarily_unavailable" | "server_error")
- `error_description` (string, optional)

Example 401 response:
```json
{
  "error": "invalid_grant"
}
```

Response header `WWW-Authenticate`: `Bearer error="invalid_token"`.

Answers `429`: Too many requests. Try again after the time `Retry-After` gives.

**Response 429: SignInProtocolError**
A protocol error, distinct from the Inbox API's error envelope: the code, and a fixed sentence when one helps. The sentence is written by the provider and never carries text from the request.
- `error` ("invalid_request" | "invalid_client" | "invalid_grant" | "invalid_scope" | "unauthorized_client" | "unsupported_grant_type" | "unsupported_response_type" | "access_denied" | "login_required" | "interaction_required" | "request_not_supported" | "request_uri_not_supported" | "registration_not_supported" | "invalid_token" | "invalid_client_metadata" | "temporarily_unavailable" | "server_error")
- `error_description` (string, optional)

Example 429 response:
```json
{
  "error": "invalid_grant"
}
```

**Errors**

| Status | Error | Meaning |
| --- | --- | --- |
| 404 | `not_found` | No such resource for this caller, or no such route. |
| 500 | `internal_error` | Something went wrong on the server. |

curl:
```sh
curl -s -X POST "https://id.doorman.example/sign-in/userinfo" \
  -H "authorization: Bearer dst_..."
```

TypeScript:
```ts
const response = await fetch("https://id.doorman.example/sign-in/userinfo", {
  method: "POST",
  headers: {
    "authorization": "Bearer dst_...",
  },
  redirect: "manual", credentials: "omit",
});
if (!response.ok) throw new Error(`The API answered ${response.status}.`);
const result = await response.json();
```

Python:
```python
import requests

response = requests.post(
    "https://id.doorman.example/sign-in/userinfo",
    headers={"authorization": "Bearer dst_..."},
    allow_redirects=False, timeout=30,
)
response.raise_for_status()
result = response.json()
```
