Sign in with Doorman
Let agents sign in to your service with their Doorman address: a standard OpenID Connect provider whose subject is an agent's inbox, with what a service configures, proves and reads.
On this page
What a service accepts
Sign in with Doorman makes an agent's address an identity your service can ask for. Doorman is the OpenID Connect provider, your service is the relying party, and the subject is the agent's inbox. The agent signs in as itself: no form, no password and no email code, and every sign-in says that the one signing in is an agent.
Nothing here is proprietary. A service adds this provider the way it adds any other: an issuer, a client id, and a secret or PKCE. Any OpenID Connect client library can speak it, and so can a sign-in service that takes a custom OpenID Connect provider.
- The owner decides
- The person who owns the agent allows your service once for each address. After that the agent signs in, and back in, alone. The owner can stop it at any time.
- A host, not a name
- Your service is identified by a host it proved is its own. People are shown that host; the name you register is a label beside it.
- Not an API credential
- Nothing a sign-in issues reaches the Inbox API, and no API key is accepted where a sign-in token is expected.
What to configure
These are the values an OpenID Connect client asks for. Discovery fills in the endpoints from the issuer.
- Issuer
https://id.doorman.example. Discovery ishttps://id.doorman.example/.well-known/openid-configuration, and the signing keys arehttps://id.doorman.example/sign-in/jwks.json. The issuer is a host of its own and does not change once you integrate.- Client id
- The identifier the console gives your relying party when you register it, or the URL of an identity document you publish.
- Secret, or PKCE
- A registered relying party gets a secret, shown once, unless you register a public one. A public one holds no secret and sends an S256 PKCE challenge with every request. A confidential one may send a challenge too.
- Redirect URI
- Each one registered exactly, on your host. The provider compares it exactly, except the port of a redirect on your own machine.
- Scopes
- A request that names none asks for
openidandemail. See scopes and claims. - Signing algorithm
ES256, and no other. An id token'skidis its key's RFC 7638 thumbprint.- Response type
code. Authorization code flow only.
| Token endpoint authentication | How the relying party presents itself |
|---|---|
client_secret_basic | The secret in an Authorization: Basic header. The default for a registered relying party. |
client_secret_post | The secret as client_secret in the form body. |
none | A public relying party: no secret, and S256 PKCE on every sign-in. |
A relying party with a secret presents it the way it registered and is refused the other way.
Register a relying party
OAuth clients in the console, one of the developer tools, lists your relying parties under Sign in with Doorman. Registering one takes a console session: no API key and no app token can.
- Name
- What your service calls itself, at most 100 characters. A label, not proof of who you are.
- Host
- The host agents sign in at, such as
app.example.net. A public DNS name of your own. A name on a shared platform is refused, because the names under it belong to different people. The host never changes: register another relying party for another host. - Redirect URIs
- At most 10, each on the host: HTTPS on the default port.
- Start URL
- Optional. Where your service starts a sign-in, on the host. See the sign-in.
- Client type
- Confidential with the secret in HTTP Basic, confidential with the secret in the body, or public.
An account registers at most 25 relying parties. The secret is shown once, on registration and again on rotation, and a rotated secret replaces the one before it at once. Editing a relying party ends the sign-ins in progress and keeps the addresses already allowed. Deleting one removes what owners decided about it.
The same operations are in the reference: register, update, rotate the secret, verify the host and delete.
Prove the host is yours
Until its host is verified, a relying party signs in only addresses of the account that registered it, and to every other account it does not exist. That is enough to build and test with. To sign in anyone's agent, serve one file from the host.
- Open the relying party in the console and choose Verify host. It shows the file's address,
https://<host>/.well-known/doorman-sign-in.json, and its JSON. - Serve that JSON at that address, over HTTPS, without a redirect.
- Choose Verify host. The provider reads the file and marks the host verified.
{
"client_id": "sic_...",
"proof": "the value the console shows"
}The read is one GET that follows no redirect and carries no credential, within 5 seconds and 8 KiB. Fields beside client_id and proof are ignored. Anything else answers 409 host_proof_failed with what was found, and changes nothing.
Or publish your identity
A service may skip registration and name itself by a document it publishes: the Client ID Metadata Document that apps use, read the same way. Its URL is the client_id.
- The host is the document's own, so it is verified by construction.
- The relying party is always public: it holds no secret and uses S256 PKCE.
- Only the redirects on the document's own host are kept.
initiate_login_uri, where the document states one, is the start URL.
The sign-in a service runs
A sign-in begins with the agent, not at your sign-in page. Your side of it is the ordinary authorization code flow.
- The agent asks for a sign-in to your service (
inboxes.signIns.create) and is handed a single-use link, good for 5 minutes, which it opens in the browser that should hold the session. - A Doorman page says which address signs in to which host and waits for a click. The click sends the browser to your start URL with
issandlogin_hint: OpenID Connect's third-party initiated login. Without a start URL the browser is sent to your front page. - Your start URL checks that
issis this issuer and begins a login: a freshstate, anonce, an S256 challenge, and a redirect to the authorization endpoint. Passlogin_hintalong. - The provider checks the request and, for the browser that opened the link, answers at once. The browser returns to your redirect with
code, yourstateandiss. Where nothing ties the browser to an address, the owner is asked instead, and the request waits up to 15 minutes. - Check
stateandiss, then exchange the code at the token endpoint within 60 seconds. Verify the id token: its signature against the published keys, and itsiss,aud,expandnonce. - Create or find the account by
sub, and start your own session. Read userinfo when you want the claims as they are now.
const ISSUER = "https://id.doorman.example";
const discovery = await (await fetch(`${ISSUER}/.well-known/openid-configuration`)).json();
// At the start URL: iss has to be this issuer, and login_hint is the address that signs in.
const url = new URL(discovery.authorization_endpoint);
url.search = new URLSearchParams({
response_type: "code",
client_id: process.env.DOORMAN_CLIENT_ID,
redirect_uri: "https://app.example.net/auth/callback",
scope: "openid email profile",
state, nonce, // random, kept in this browser's session
code_challenge: challenge, code_challenge_method: "S256",
login_hint: loginHint,
}).toString();
// Redirect the browser to url.
// At the redirect URI: check state and iss first, then exchange the code once.
const response = await fetch(discovery.token_endpoint, {
method: "POST",
headers: {
"content-type": "application/x-www-form-urlencoded",
authorization: `Basic ${btoa(`${process.env.DOORMAN_CLIENT_ID}:${process.env.DOORMAN_CLIENT_SECRET}`)}`,
},
body: new URLSearchParams({
grant_type: "authorization_code", code,
redirect_uri: "https://app.example.net/auth/callback", code_verifier: verifier,
}),
});
const tokens = await response.json();
// Verify tokens.id_token (ES256, the keys at discovery.jwks_uri) before trusting a claim.The operations are in the reference: discovery, the keys, authorize, token and userinfo. A request with prompt=none is honored: where the owner would have to decide, the answer is login_required.
Scopes and claims
| Scope | What it tells your service |
|---|---|
openid | The agent's subject: a stable identifier for the address, and that it is an agent. Every sign-in carries it. |
email | The address the agent signs in as, which the service can write to. |
profile | The address's display name, and an identifier for its owner that is different at every service. |
owner_profile | The name of the person or organization that owns the agent. Released only where the owner allowed it for that service. |
owner_email | The owner's own email address. Released only where the owner allowed it for that service. |
A request that names scopes must name openid. Scopes this provider does not have are ignored, as OpenID Connect asks, so offline_access and a sign-in service's own scopes do not fail a request. owner_profile and owner_email say who owns the agent: ask for them by name, and you are told only where the owner allowed it for your service. Where they are asked for and not allowed, the sign-in still succeeds without them, and the token answer's scope says what was granted.
| Claim | Scope | Meaning |
|---|---|---|
sub | openid | The address's subject. The same at every service, and a new one if the address is ever given up and issued again. Key your account on this, not on the address. |
actor_type | openid | Always agent: the one signing in is software acting for its owner. |
email | email | The address the agent signs in as. |
email_verified | email | Always true: the provider is where the address lives. |
name | profile | The address's display name, when it has one. |
owner_sub | profile | Who owns the agent, as an identifier that is different at every service and the same for every agent of that owner at yours. |
owner_name | owner_profile | The owner's name, only where the owner allowed it for your service. |
owner_email | owner_email | The owner's own email address, only where the owner allowed it for your service. |
owner_email_verified | owner_email | Always true where owner_email is present. |
{
"iss": "https://id.doorman.example",
"aud": "sic_01jc5f1a2b3c4d5e6f7g8h9j0k",
"iat": 1793959500,
"exp": 1793960100,
"auth_time": 1793959490,
"jti": "ddddddddddddddddddddddddddddddddddddddddddd",
"nonce": "n-0S6_WzA2Mj",
"sub": "f0Jx2kQp9wLr7TzV3mYb8nHc5dGs1aKe4uWq6oPi0Ag",
"actor_type": "agent",
"email": "concierge@doorman.example",
"email_verified": true
}Userinfo answers a SignInUserInfo: every claim derived again from live state on each call, so a renamed address, a withdrawn permission or a stopped address shows at once.
Lifetimes and keys
- A code is single use and lasts 60 seconds. A code presented twice ends the tokens its first exchange returned.
- The id token and the access token last 10 minutes. The access token reads userinfo and nothing else.
- There is no refresh token. A longer session is your own: keep it as you keep any session, and start a new sign-in when you need the provider's word again.
- Discovery and the keys may be kept for 300 seconds. A new key is published before it signs, so read the keys again when a token names a
kidyou do not have.
When the owner stops a sign-in
The owner sees every service an address signs in to in their Passport, with the first and last sign-in and their count, and can stop one at any time. Stopping ends what the provider can end: the links, codes and tokens of that address at your service. The token exchange refuses a code issued before the stop, and userinfo answers 401 for a token issued before it.
The session your service keeps is your own, and the provider cannot end it. Read userinfo while a session is young, or ask for a fresh sign-in before anything that matters, and treat 401 or access_denied as the owner's no.
When a request is refused
A request whose relying party or redirect cannot be trusted is answered where it is and never redirected. Every later refusal goes back to your redirect with error, your state and iss. The token and userinfo endpoints answer { "error": "<code>" }, sometimes with an error_description: a fixed sentence written by the provider, never text taken from the request. A program branches on error.
| Error | When |
|---|---|
invalid_request | A parameter the endpoint reads is missing, malformed, repeated or too long, or a public relying party sent no S256 challenge. |
invalid_client | The relying party is unknown, deleted or lapsed, or its authentication failed or came the way it did not register. |
invalid_grant | The code is unknown, expired, used, or not this relying party's for this redirect and verifier. Also a code issued before the owner stopped the address. |
invalid_scope | The request names scopes and leaves out openid. |
unauthorized_client | Named in the protocol and kept in this provider's vocabulary. It does not answer it today; treat it as a refusal if it ever appears. |
unsupported_grant_type | The grant is not authorization_code. |
unsupported_response_type | The response type is not code. |
access_denied | The owner denied the sign-in, or stopped this address signing in to your service. |
login_required | The request asked for prompt=none and the owner would have to decide. |
interaction_required | Named in the protocol and kept in this provider's vocabulary. It does not answer it today; treat it as a refusal if it ever appears. |
request_not_supported | The request carries a request object. Send plain parameters. |
request_uri_not_supported | The request carries a request_uri. Send plain parameters. |
registration_not_supported | The request carries a registration parameter. Register in the console or publish an identity document. |
invalid_token | At userinfo: the access token is missing, unknown, expired or ended. |
invalid_client_metadata | A published identity document could not be read or did not check out. |
temporarily_unavailable | A rate limit was reached, or too many requests are waiting. Retry-After says when to try again. |
server_error | Named in the protocol and kept in this provider's vocabulary. It does not answer it today; treat it as a refusal if it ever appears. |

