Skip to content

Commit b2ccab1

Browse files
committed
Add OAuth dynamic client registration documentation
1 parent dad70c0 commit b2ccab1

1 file changed

Lines changed: 47 additions & 2 deletions

File tree

docs/security/oauth.adoc

Lines changed: 47 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -353,8 +353,9 @@ When null, the base URL is derived in this order:
353353
----
354354
oauthAuthorizationServerMetadataService:
355355
enabled: true
356-
base-url: https://api.example.com # optional
357-
authorize-endpoint-uri: /authorize # must match oauthAuthorizationService URI
356+
base-url: https://api.example.com # optional
357+
authorize-endpoint-uri: /authorize # must match oauthAuthorizationService URI
358+
registration-endpoint-uri: /register # optional, enables registration_endpoint in metadata
358359
----
359360

360361
=== Protected Resource Metadata (RFC 9728)
@@ -401,6 +402,50 @@ oauthProtectedResourceMetadataService:
401402
base-url: https://api.example.com # optional, resolves TLS proxy mismatch
402403
----
403404

405+
=== Dynamic Client Registration (RFC 7591)
406+
407+
NOTE: Available from RESTHeart v9.3.0. Disabled by default.
408+
409+
`oauthClientRegistrationService` exposes `POST /register` per RFC 7591, allowing OAuth clients to self-register without manual admin configuration.
410+
This is required by tools such as mcp-inspector and MCP SDK clients that perform dynamic registration before starting the authorization flow.
411+
412+
[source,bash]
413+
----
414+
http POST [RESTHEART-URL]/register \
415+
redirect_uris:='["https://client.example.com/callback"]' \
416+
client_name="My MCP Client" \
417+
token_endpoint_auth_method=none
418+
----
419+
420+
[source,json]
421+
----
422+
{
423+
"client_id": "550e8400-e29b-41d4-a716-446655440000",
424+
"client_id_issued_at": 1712345678,
425+
"redirect_uris": ["https://client.example.com/callback"],
426+
"client_name": "My MCP Client",
427+
"token_endpoint_auth_method": "none",
428+
"grant_types": ["authorization_code"],
429+
"response_types": ["code"]
430+
}
431+
----
432+
433+
The endpoint is publicly accessible (no authentication required). The returned `client_id` is a UUID that clients must use in subsequent authorization requests.
434+
435+
NOTE: RESTHeart's authorization service embeds `client_id` directly in the authorization code JWT without database validation. No client storage is required on the server side.
436+
437+
To enable dynamic client registration and advertise it in the AS metadata:
438+
439+
[source,yml]
440+
----
441+
oauthClientRegistrationService:
442+
enabled: true
443+
444+
oauthAuthorizationServerMetadataService:
445+
enabled: true
446+
registration-endpoint-uri: /register # adds registration_endpoint to discovery metadata
447+
----
448+
404449
=== Token Manager Configuration
405450

406451
The JWT Token Manager is enabled by default in RESTHeart v9:

0 commit comments

Comments
 (0)