Skip to content

AS: open Dynamic Client Registration as an opt-in mode, with clients pending review until the Data Custodian approves them #356

Backlog

Description

@dfcoffin

Summary

Add open Dynamic Client Registration to the AS as an option a Data Custodian switches on: a Third Party registers at POST /oauth2/register without an initial access token, and its client stays pending review until the DC approves it. This is the portal process most DCs use today (anyone applies; the DC investigates before the registration is complete), carried out with RFC 7591.

Decision (owner, 2026-11-30; recorded on #252):

Why open mode is not the default

Without an initial access token, /oauth2/register becomes an anonymous write endpoint. Spring Security keeps open registration off by default for the same reason (OAuth2ClientRegistrationAuthenticationProvider.setOpenRegistrationAllowed, default false; RFC 7591 §3 leaves the choice to the server). The risks are:

  • scripted mass registration that fills the client table;
  • clients registered with a convincing client_name or logo_uri, shown to customers on the consent screen;
  • redirect URIs that point at an attacker's site.

Every one of these must be closed before open can be used outside local.

Scope

  1. Setting: espi.authserver.registration.mode: token | open, default token. In open mode, clientRegistrationSecurityFilterChain accepts a request without a bearer token and the provider runs with setOpenRegistrationAllowed(true). A request that does carry a client.create token is still accepted. Startup logs the mode in force.
  2. A dedicated pending_review status. Do not reuse suspended, which means an approved client was stopped; mixing the two muddles the audit log, the reporting views (AS PostgreSQL reporting views count a client on a timed suspension or lock as active #355) and the admin's view.
  3. Approval and rejection through the admin status API (fix(authserver): client management API: list always 500, status without reason 500s after applying, bulk logs raw ids, null scope saved; fix or retire the controller #344 PR 3): pending_review → active or revoked, each audited with the administrator and a reason. Pending clients are listed and filterable.
  4. Abuse limits on /oauth2/register in open mode:
  5. Purge of clients still pending_review after a set period (configurable, e.g. 30 days), audited. It must not touch any other status.
  6. Notifying the Third Party. RFC 7591 has no "pending" response: the registration answers 201 with client_id and secret, and the token endpoint answers invalid_client until approval, which a TP cannot tell from wrong credentials (RFC 6749 keeps that error vague on purpose). So:
  7. Docs: the two modes, the default, what a DC must configure before turning on open (rate limit, purge period, pending cap), and the review process.
  8. Tests:
    • token mode: a registration without a token is 401, as today;
    • open mode: a registration without a token is 201 and stored pending_review; with a client.create token it is active;
    • a pending client is refused at /oauth2/token, /oauth2/authorize and introspection; after approval it works; after rejection it stays refused;
    • the rate limit, the size limit and the pending cap;
    • the purge removes only expired pending clients;
    • the setting defaults to token, and the production profiles do not set open.

Dependencies

🤖 Generated with Claude Code

Activity

  1. added
    enhancement
    NAESB ESPI Standard
    on Nov 30, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    NAESB ESPI Standardenhancement

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions