RFC 7591 — OAuth 2.0 Dynamic Client Registration (DCR)
Implemented (admin/DCRHandler)
Source: docs/oauth/RFC_7591.md
RFC 7591 — OAuth 2.0 Dynamic Client Registration (DCR) ¶
Status: Standards Track
Published: 2015-07
L-tier / T-tier: L3 · T0 (setup)
OneAuth coverage: Implemented (admin/DCRHandler)
See also:RFC_7592.md·CIMD.md·LANDSCAPE.md
In one sentence ¶
DCR is the standardized way for clients to register themselves with an AS
at runtime — POST /register with a JSON metadata document, get back a
client_id (and optionally a client_secret), no human in the loop.
What problem does it solve? ¶
| Without 7591 | With 7591 |
|---|---|
| Every new client integration requires manual provisioning — fill out a form, get sent credentials in a (hopefully encrypted) email | Self-service onboarding via API call |
| SaaS platforms with thousands of integrating apps can’t scale developer-portal flows | One AS endpoint; one JSON body |
| Programmatic federation (an AS auto-registering child ASes, an MCP client auto-registering against a server) requires vendor-specific APIs | Standardized — works across any 7591-conformant AS |
| Onboarding includes ad-hoc fields per IdP | Standardized client metadata schema (RFC 7591 §2) |
DCR is the bedrock spec for any platform that wants to scale developer
onboarding beyond manual provisioning. It’s why modern OAuth marketplaces
(Slack app directory, Salesforce AppExchange, MCP server registries) can
function without a human approving every new client.
Relatable example ¶
You’re building a new app that integrates with Slack. Without DCR, you’d:
- Sign in to Slack’s developer portal
- Fill out a multi-page form (redirect URIs, scopes, app name, icon, …)
- Wait for approval
- Get a
client_idandclient_secretto paste into your config
With DCR, a developer SDK can just:
resp = requests.post(
"https://slack.example/apps/dcr",
json={
"client_name": "My Integration",
"redirect_uris": ["https://my-app.com/cb"],
"grant_types": ["authorization_code", "refresh_token"],
"scope": "users:read channels:read"
}
)
creds = resp.json()
# creds: {client_id, client_secret, registration_access_token, registration_client_uri}
The whole onboarding flow becomes one HTTP POST. The MCP ecosystem in
particular is standardizing on DCR for this exact reason — connecting a
new AI agent to an MCP server should be a single API call, not a
form-filling exercise.
Key concepts ¶
- One endpoint:
POST /register(RFC 7591 §3). Takes a JSON
client_metadatabody; returns the registered client + credentials. - Standardized metadata fields (§2):
redirect_uris,client_name,
client_uri,logo_uri,scope,contacts,tos_uri,policy_uri,
jwks_uri/jwks,token_endpoint_auth_method,grant_types,
response_types,software_id,software_version, plus extensions
from later RFCs (authorization_details_typesfor RAR,
backchannel_logout_urifor OIDC BCL, etc.). - Open vs authenticated DCR. Open DCR (§2) lets anyone register — fine
for prototype tooling, dangerous in production. Authenticated DCR
(§3.2) requires a registration initial access token before the
register call succeeds. Production deployments almost always use the
authenticated form. In OneAuth,admin.InitialAccessTokenAuthset as
AppRegistrar.RegistrationAuthadmitsPOST /apps/dcrfor holders of
an initial access token and opens no other admin route. - Returns include
registration_access_token+registration_client_uri
(§3.2.1). These tie into RFC 7592 management — the token
lets the client later read/update/delete its own registration without
needing initial access credentials again. - Software statements (§2.3) let a third party (e.g., a software
publisher) vouch for client metadata via a signed JWT. Allows
“anyone can register, but only with metadata pre-blessed by Apple.”
Wire example ¶
Initial registration (open / unauthenticated):
POST /apps/dcr HTTP/1.1
Host: as.example.com
Content-Type: application/json
{
"client_name": "Acme Calendar Integration",
"redirect_uris": ["https://acme.example.com/oauth/cb"],
"grant_types": ["authorization_code", "refresh_token"],
"token_endpoint_auth_method": "client_secret_basic",
"scope": "calendar.read calendar.write",
"contacts": ["dev@acme.example.com"]
}
HTTP/1.1 201 Created
Content-Type: application/json
Cache-Control: no-store
{
"client_id": "s6BhdRkqt3",
"client_secret": "cf136dc3c1fc93f31185e5885805d",
"client_id_issued_at": 1717000000,
"client_secret_expires_at": 0,
"client_name": "Acme Calendar Integration",
"redirect_uris": ["https://acme.example.com/oauth/cb"],
"grant_types": ["authorization_code", "refresh_token"],
"token_endpoint_auth_method": "client_secret_basic",
"scope": "calendar.read calendar.write",
"registration_access_token": "reg-tok-abcdef...", // RFC 7592
"registration_client_uri": "https://as.example.com/apps/dcr/s6BhdRkqt3" // RFC 7592
}
The client now has everything it needs to start the auth-code flow plus
the credentials to manage its own registration later.
Where it lands on the OAuth abstraction ¶
- L3 client onboarding. DCR is the slot at T0 for “how does a new
client get itsclient_id?” - T0 (setup). Discovery (RFC 8414) tells clients where to register;
DCR is how they register. - 7591 is paired with 7592 management — issuance and
lifecycle, one spec each.
OAuth 2.0 status ¶
Part of the 2.0 ecosystem from 2015. Most major IdPs ship DCR support — but
often gated behind admin policy. Auth0 supports it (off by default);
Keycloak supports it; Okta supports it for OIDC.
The 2.0 default is open DCR. In production this is almost always
disabled — open DCR means anyone with HTTP access to the AS can register a
client, which becomes a flood vector and a source of vanity client_ids.
OAuth 2.1 status ¶
Not directly changed by 2.1. The endpoint behavior, metadata schema, and
response shape carry through. 2.1 tightens redirect URI validation (RFC
9700 §2.1.2 / OAuth 2.1 §3.1.2) which applies at registration time — non-
HTTPS redirect URIs (other than loopback) must be rejected.
Migration path (manual provisioning → DCR) ¶
If you currently provision clients manually:
- Stand up the DCR endpoint behind an admin-token gate. Authenticated
DCR with initial-access-token requirement (§3.2). This is the form
most production IdPs ship. On the OneAuth reference server, list the
tokens underadmin_auth.dcr_initial_access_tokens(each at least 32
bytes). - Migrate existing clients lazily. Don’t auto-import legacy clients
into the DCR registry; new clients get DCR, existing ones stay where
they are. They differ only in how they got their credentials. - Wire
registration_endpointinto AS metadata (RFC 8414) so
discovery-aware client SDKs find your DCR endpoint automatically. - Document the auth model — open vs initial-token vs software-statement
gating. Each fits a different deployment posture.
When NOT to use it ¶
- Strictly internal AS with a known, small set of clients curated by
a platform team. The audit win of “every client provisioning is a
ticket” can outweigh the convenience of DCR. - Locked-down regulated environments where every new client must go
through a compliance review. Manual provisioning is the feature there. - Clients with credentials that can’t be carried in JSON — e.g.,
hardware-key-bound clients in some FAPI deployments — need vendor
extensions to DCR or out-of-band provisioning.
OneAuth status ¶
| 7591 surface | Status | Where (grep-verified) | Notes |
|---|---|---|---|
POST /apps/dcr endpoint |
Implemented | admin/dcr.go DCRHandler.ServeHTTP |
RFC 7591 §3 compliant |
client_metadata JSON parsing |
Implemented | admin/dcr.go DCRHandler.ServeHTTP decodes into DCRRequest |
Body capped at 64 KiB (413 above it) since 0.1.48 |
client_id + client_secret generation |
Implemented | admin/registrar.go AppRegistrar.Register (behind the ClientRegistrar interface) |
High-entropy via secure-random. A none client gets no secret (0.1.50) |
client_id_issued_at |
Implemented | admin/dcr.go DCRResponse.ClientIDIssuedAt |
Unix seconds |
client_secret_expires_at |
Implemented | admin/dcr.go DCRResponse.ClientSecretExpiresAt |
0 = never expires (per 7591 §3.2.1) |
| Authenticated DCR (admin credential) | Implemented | admin/dcr.go DCRHandler.ServeHTTP calls DCRHandler.Auth.Authenticate |
A nil Auth answers 401 since 0.1.44. Open DCR needs admin.NewNoAuth() |
| Initial access token (§3) | Implemented | admin/auth.go InitialAccessTokenAuth, set as AppRegistrar.RegistrationAuth |
Sent as Authorization: Bearer, compared in constant time. Admits POST /apps/dcr only. Reference server: admin_auth.dcr_initial_access_tokens, 32 bytes minimum (0.1.55) |
registration_access_token + registration_client_uri issuance |
Implemented | admin/dcr.go DCRResponse.RegistrationAccessToken / RegistrationClientURI per RFC 7592 §3 |
The URI is built from AppRegistrar.IssuerBaseURL, or from the request only for a loopback host; otherwise registration answers 500 (0.1.44) |
| Redirect URI validation | Implemented | admin/registrar.go validateRedirectURI, called from AppRegistrar.Register |
https, loopback http (RFC 8252 §7.3) or a private-use scheme. Fragments, userinfo and https without a host are refused. Every redirect problem answers invalid_redirect_uri (ErrInvalidRedirectURI, which wraps ErrInvalidClientMetadata) since 0.1.50 |
token_endpoint_auth_method + grant_types checks |
Implemented | admin/registrar.go validateClientMetadata |
On register and update, both are checked against what the token endpoint supports and against each other: no client_credentials for a none client, and authorization_code needs a redirect URI (0.1.50) |
Default token_endpoint_auth_method |
Implemented | admin/registrar.go effectiveAuthMethod |
client_secret_basic (RFC 7591 §2), stored and echoed alike (0.1.50) |
authorization_details_types (RFC 9396 RAR) |
Implemented | admin/dcr.go DCRRequest.AuthorizationDetailsTypes |
Client can declare which RAR types it expects |
backchannel_logout_uri (OIDC BCL) |
Implemented | admin/dcr.go DCRResponse.BackchannelLogoutURI echoes the registered receiver metadata |
Validated by validateBackchannelLogoutURI |
dpop_bound_access_tokens (RFC 9449 §5.2) |
Implemented | admin/dcr.go DCRRequest.DPoPBoundAccessTokens, echoed on DCRResponse |
The token endpoint refuses this client’s requests without a DPoP proof (0.1.41) |
require_pushed_authorization_requests (RFC 9126 §6) |
Implemented | admin/dcr.go DCRRequest.RequirePushedAuthorizationRequests, echoed on DCRResponse |
/authorize refuses this client’s requests that don’t come through PAR (0.1.50) |
authorization_signed_response_alg (JARM §3) |
Implemented | admin/dcr.go DCRRequest.AuthorizationSignedResponseAlg, echoed on DCRResponse |
Checked against AppRegistrar.AuthorizationSigningAlgs, so none is refused (issue 413). See JARM.md |
| Unknown metadata | Ignored, as §2 requires | admin/dcr.go DCRHandler.ServeHTTP |
A field the AS doesn’t understand gets a normal registration and is neither stored nor echoed. The response shows what was stored, so a client compares it with what it sent to see what took. oneauth dcr --metadata refuses an unknown field in its file before sending (issue 557) |
| SDK and CLI | Implemented | client.RegisterClient, client.ClientRegistrationRequest / Response; oneauth dcr register / get / put / delete |
The SDK structs carry every field the server reads and echoes, and a drift test keeps them in step. The CLI takes any field through --metadata FILE (issue 557) |
| Response caching | Implemented | admin/no_store.go noStore |
Cache-Control: no-store on every DCR response, errors included (0.1.44) |
| Rate limiting | Implemented | admin/registrar.go AppRegistrar.AuthRateLimiter |
Per client address, checked before the credential. Nil disables it; the reference server sets it (0.1.44) |
| Server errors | Implemented | admin/dcr.go DCRHandler.ServeHTTP |
The detail is logged and the client gets server_error with “internal server error” (0.1.50) |
jwks_uri (§2) |
Implemented | admin/registrar.go validateKeyMetadata; apiauth/client_jwks.go ClientJWKSFetcher |
For private_key_jwt only, never beside jwks. No key is stored: client authentication fetches the set, picks the key by the assertion’s kid, and refetches once on an unknown kid (at most every 30 s), so the client rotates keys by publishing them. The fetch is https only, refuses private addresses at dial time, follows no redirect and reads at most 64 KiB. Reference server: admin_auth.allow_private_client_hosts and client_fetch_ca_file, for test harnesses (issue 507) |
token_endpoint_auth_signing_alg (OIDC Registration §2) |
Implemented | admin/dcr.go DCRRequest.TokenEndpointAuthSigningAlg |
Asymmetric algorithms only. A jwks_uri client’s assertions must use it when set (issue 507) |
logo_uri, policy_uri, tos_uri (§2) |
Implemented | admin/registrar.go validateDisplayURIs; the consent page in apiauth/authorize_verification_handler.go |
Absolute https only. The consent page shows the logo and links to the policy and terms, and adds only the logo’s origin to the page’s CSP img-src (issue 507) |
subject_type, sector_identifier_uri (OIDC Registration §2, §5) |
Implemented | admin/registrar.go subjectSector, keepsSubjectSector |
pairwise needs AppRegistrar.PairwiseSubjects. The sector document is fetched through AppRegistrar.FetchSectorIdentifier (ClientJWKSFetcher.SectorRedirectURIs, with the jwks_uri guards) and must list every redirect URI, on update too. An update can’t change the subject type or sector (issue 507) |
response_types (§2) |
Implemented | admin/registrar.go validateResponseTypes |
Default ["code"]. id_token and id_token token need AppRegistrar.AllowImplicit and the implicit grant type, and a code the client asks for needs authorization_code, as §2.1 pairs them (issue 507) |
software_statement (§2.3) |
Not implemented | — | Niche; no observed demand |
Discovery advertisement (registration_endpoint in AS metadata) |
Implemented | Via ASServerMetadata.RegistrationEndpoint field |
Clients auto-find DCR endpoint |
Related RFCs ¶
- RFC 7592 — DCR Management; the lifecycle pair to 7591’s issuance
- Client ID Metadata Document lets a client use a URL it controls as its
client_id, so it needs no registration. MCP clients use it in place of DCR. - RFC 8414 —
registration_endpointadvertisement - RFC 9396 — RAR;
authorization_details_typesmetadata field - OIDC Dynamic Client Registration 1.0 — OIDC superset of 7591 with id-specific fields