Commit bcb0c46
authored
Add support for Dynamic Client Registration (#346)
Implements full OpenID Connect Dynamic Client Registration 1.0 + RFC 7591/7592 support for v7, validated against the OpenID conformance suite.
### Features
**Registration endpoint (RFC 7591 / OIDC DCR 1.0)**
- Client Registration Endpoint (`POST`) — register clients dynamically with the OP assigning `client_id`, `client_secret`, and a Registration Access Token (RAT).
- Configurable access control: open registration or Initial Access Token mode.
- Optional "register, then approve" — config option to create dynamically registered clients **disabled** until an administrator reviews and enables them.
- Configurable default scope set assigned when a registration omits `scope`.
**Client Configuration Endpoint (RFC 7592)**
- Read (`GET`), Update (`PUT`, full-replace semantics) and Delete (`DELETE`) of a registered client, authenticated by the Registration Access Token.
- RAT is stored only as a hash; the plaintext is returned once and **rotated** on each read/update (RFC 7592 §3 requires `registration_access_token` + `registration_client_uri` in the response).
- Uniform `401` on every auth failure so the endpoint never reveals whether a client exists.
**Metadata validation & enforcement**
- Strict validation of client-supplied metadata: `redirect_uris`, informational URIs (`logo_uri`/`client_uri`/`policy_uri`/`tos_uri`), `contacts`, `application_type`, `request_uris`, `subject_type`, `default_max_age`, `require_auth_time`, `default_acr_values`, `initiate_login_uri`, `software_id`/`software_version`.
- `redirect_uris` constrained by `application_type` (native → custom-scheme/loopback only; web+implicit → https, non-localhost) and rejected if they contain a fragment (incl. empty trailing `#`).
- `grant_types` / `response_types` / `token_endpoint_auth_method` rejected when outside the OP's supported sets (single source of truth shared by discovery, validator, and admin form).
- `response_type` ↔ `grant_type` correspondence enforced (auto-normalized on registration, live-adjusted in the admin UI).
- `default_acr_values` restricted to the OP's advertised `acr_values_supported`.
- Unsupported features (encrypted/signed UserInfo & ID Tokens, pairwise `sector_identifier_uri`, front-channel logout, etc.) are rejected rather than silently ignored.
- Impersonation protection (OIDC DCR §9.1) — protected informational URIs must share a host with a registered redirect URI.
- Admin-only properties (e.g. `authproc`) are scrubbed from registration input and preserved across DCR updates.
- `Content-Type: application/json` enforced on register/update requests.
**Client model & admin UI**
- Per-client metadata is presence-based and stored as the single source of truth (getters return the stored value; spec defaults applied at registration time).
- `is_confidential` kept in lockstep with `token_endpoint_auth_method` / `application_type`, on both registration and admin save.
- Admin form gains all client metadata fields (logo/client/policy/tos URIs, contacts, application type), a multiselect `default_acr_values` bound to supported values, and live JS for response/grant-type correspondence and public/confidential client type.
**Discovery**
- OP metadata now advertises the supported `response_types`, `grant_types`, and `token_endpoint_auth_methods` (including `none`).
**Docs**
- Supported-specs list, configuration reference, and the v6→7 upgrade guide updated, including new config options, client properties, and transition guidance for existing/pre-DCR clients.1 parent 2244d7f commit bcb0c46
59 files changed
Lines changed: 6366 additions & 89 deletions
File tree
- .github/workflows
- config
- conformance-tests
- docker
- ssp
- docs
- public/assets/js/src
- routing
- routes
- services
- src
- Codebooks
- Controllers
- Admin
- Entities
- Interfaces
- Factories
- Entities
- Grant
- Forms
- Controls
- Helpers
- Repositories
- Server
- Exceptions
- Grants
- Registration
- RequestRules/Rules
- Services
- Api
- Utils
- templates/clients
- includes
- tests/unit/src
- Controllers
- Entities
- Factories/Entities
- Forms
- Helpers
- Server
- Grants
- Registration
- RequestRules/Rules
- Services
- Utils
Some content is hidden
Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
266 | 266 | | |
267 | 267 | | |
268 | 268 | | |
| 269 | + | |
| 270 | + | |
| 271 | + | |
| 272 | + | |
| 273 | + | |
| 274 | + | |
| 275 | + | |
269 | 276 | | |
270 | 277 | | |
271 | 278 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
31 | 31 | | |
32 | 32 | | |
33 | 33 | | |
34 | | - | |
| 34 | + | |
35 | 35 | | |
36 | 36 | | |
37 | 37 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
448 | 448 | | |
449 | 449 | | |
450 | 450 | | |
| 451 | + | |
| 452 | + | |
| 453 | + | |
| 454 | + | |
| 455 | + | |
| 456 | + | |
| 457 | + | |
| 458 | + | |
| 459 | + | |
| 460 | + | |
| 461 | + | |
| 462 | + | |
| 463 | + | |
| 464 | + | |
| 465 | + | |
| 466 | + | |
| 467 | + | |
| 468 | + | |
451 | 469 | | |
452 | 470 | | |
453 | 471 | | |
| |||
570 | 588 | | |
571 | 589 | | |
572 | 590 | | |
| 591 | + | |
| 592 | + | |
| 593 | + | |
| 594 | + | |
| 595 | + | |
| 596 | + | |
| 597 | + | |
| 598 | + | |
| 599 | + | |
| 600 | + | |
| 601 | + | |
| 602 | + | |
| 603 | + | |
| 604 | + | |
| 605 | + | |
| 606 | + | |
| 607 | + | |
| 608 | + | |
| 609 | + | |
| 610 | + | |
| 611 | + | |
| 612 | + | |
| 613 | + | |
| 614 | + | |
| 615 | + | |
| 616 | + | |
| 617 | + | |
| 618 | + | |
| 619 | + | |
| 620 | + | |
| 621 | + | |
| 622 | + | |
| 623 | + | |
| 624 | + | |
| 625 | + | |
| 626 | + | |
| 627 | + | |
| 628 | + | |
| 629 | + | |
| 630 | + | |
| 631 | + | |
| 632 | + | |
| 633 | + | |
| 634 | + | |
| 635 | + | |
| 636 | + | |
| 637 | + | |
| 638 | + | |
| 639 | + | |
| 640 | + | |
| 641 | + | |
| 642 | + | |
| 643 | + | |
| 644 | + | |
| 645 | + | |
| 646 | + | |
| 647 | + | |
| 648 | + | |
| 649 | + | |
| 650 | + | |
| 651 | + | |
| 652 | + | |
| 653 | + | |
| 654 | + | |
| 655 | + | |
| 656 | + | |
| 657 | + | |
| 658 | + | |
| 659 | + | |
| 660 | + | |
| 661 | + | |
| 662 | + | |
| 663 | + | |
| 664 | + | |
| 665 | + | |
| 666 | + | |
| 667 | + | |
| 668 | + | |
| 669 | + | |
| 670 | + | |
| 671 | + | |
| 672 | + | |
| 673 | + | |
| 674 | + | |
| 675 | + | |
| 676 | + | |
| 677 | + | |
| 678 | + | |
| 679 | + | |
| 680 | + | |
| 681 | + | |
| 682 | + | |
| 683 | + | |
| 684 | + | |
| 685 | + | |
| 686 | + | |
| 687 | + | |
| 688 | + | |
| 689 | + | |
| 690 | + | |
| 691 | + | |
| 692 | + | |
| 693 | + | |
| 694 | + | |
| 695 | + | |
| 696 | + | |
| 697 | + | |
| 698 | + | |
| 699 | + | |
| 700 | + | |
| 701 | + | |
| 702 | + | |
| 703 | + | |
| 704 | + | |
| 705 | + | |
| 706 | + | |
| 707 | + | |
| 708 | + | |
| 709 | + | |
| 710 | + | |
| 711 | + | |
| 712 | + | |
| 713 | + | |
| 714 | + | |
| 715 | + | |
| 716 | + | |
| 717 | + | |
| 718 | + | |
| 719 | + | |
| 720 | + | |
573 | 721 | | |
574 | 722 | | |
575 | 723 | | |
| |||
0 commit comments