Guide 04 · RFC 7591 Registration

RFC 7591 Dynamic Client Registration

Register public PKCE or confidential OIDC relying parties immediately at POST https://protext.org/oidc/register using RFC 7591 without creating a provider account first.

SPEC.md §6.5SPEC.md §8app/oidc/register/route.tsdocs/RELYING-PARTIES.md
Quick answer · PROTEXT/0.1

Any relying party can register dynamically at POST https://protext.org/oidc/register (RFC 7591) with JSON metadata and receive a px_* client_id in one HTTP 201 response—no developer account required.

Public clients (token_endpoint_auth_method: "none", the default) receive only a client_id and use PKCE S256. Confidential clients (client_secret_post or client_secret_basic) also receive a 32-byte client_secret stored hashed at rest on the provider.

POST /oidc/register request and validation rules (app/oidc/register/route.ts)

FieldRequirementValidation & behavior
client_nameRequiredString trimmed to 2–80 characters; displayed on the consent screen
redirect_urisRequired (1–10 items)Must be https:// or loopback http://localhost / http://127.0.0.1 with no # fragment
token_endpoint_auth_methodOptional (default: none)"none" creates a public PKCE client; any other value creates a confidential client with a 32-byte secret
client_uriOptionalMust start with https:// if provided
logo_uriOptionalMust start with https:// if provided
Response (HTTP 201)JSON, Cache-Control: no-storeReturns client_id (px_*), optional client_secret, redirect_uris, grant_types, response_types, and endpoint URLs
Wire format & code example

Registering a public browser client and a confidential server client via curl

Exact curl requests matching app/developers/page.tsx and examples/node-relying-party/server.mjs.

# 1. Public client (browser / SPA / mobile, PKCE mandatory, no secret)
curl -X POST https://protext.org/oidc/register \
  -H 'content-type: application/json' \
  -d '{
    "client_name": "My App",
    "redirect_uris": ["https://myapp.example/protext/callback"],
    "client_uri": "https://myapp.example"
  }'

# 2. Confidential server client (issues a client_secret)
curl -X POST https://protext.org/oidc/register \
  -H 'content-type: application/json' \
  -d '{
    "client_name": "My Server RP",
    "redirect_uris": ["http://localhost:4000/cb"],
    "token_endpoint_auth_method": "client_secret_post"
  }'

Why Protext supports open RFC 7591 registration

Because Protext is a multi-provider protocol (§8), a relying party cannot pre-register manually at every independent Protext provider on the internet. When a person enters a handle hosted at another provider (<handle>@<provider>), the relying party fetches that provider's /.well-known/openid-configuration, posts to its registration_endpoint, and proceeds directly into the authorization code flow.

To keep trust transparent, dynamically registered clients are flagged with dynamic: true in the database and explicitly labelled as self-registered on the consent screen (§6.5). Regardless of how a client registered, nothing is shared until the person ticks individual items.

Account-attached registration vs. dynamic registration

Developers who want to manage and delete apps from a signed-in dashboard can log in at /developers and register clients under their own Protext account. Dynamically registered apps work identically at /oidc/authorize and /oidc/token and return CORS headers (Access-Control-Allow-Origin: *) on /oidc/register.

  • Non-HTTPS redirect URIs are rejected with HTTP 400 invalid_redirect_uri unless the hostname is localhost or 127.0.0.1.
  • Redirect URIs containing URL fragments (#) are rejected per OAuth 2.1 security rules.
  • Real relying parties already registered on protext.org via RFC 7591 include the built-in demo client (px_demo), America.co (claim.america.co), and TeamMeet (teammeet.io) as documented in docs/RELYING-PARTIES.md.
Next step

Verify against the normative specification or register your client.

Read PROTEXT/0.1 SpecDeveloper Quickstart10 Languages
FAQ

Frequently asked questions

Do I need an API key or account to call POST /oidc/register?

No. POST https://protext.org/oidc/register is an open RFC 7591 endpoint. Supply a valid client_name and 1 to 10 redirect_uris to receive a px_* client_id immediately.

How are self-registered apps shown to users during sign-in?

Per SPEC.md §6.5, the Protext consent screen informs the person whenever a relying party was dynamically self-registered, and the person still chooses item by item what to release.

Can I register http://localhost redirect URIs for local testing?

Yes. Loopback URIs using localhost or 127.0.0.1 are accepted without HTTPS, and at authorization time any loopback port is permitted on the same hostname and pathname per RFC 8252 §7.3.

When should I choose public (none) vs. confidential client registration?

Use token_endpoint_auth_method: "none" for browser apps, SPAs, and native apps that cannot keep secrets safe; PKCE S256 protects the code exchange. Use client_secret_post or client_secret_basic when your token exchange runs on a trusted server.

Are client_id values considered secrets?

No. Client IDs (px_*) are public identifiers included in authorization URLs and browser SDK tags. Only client_secret (for confidential server clients) is secret and stored hashed with SHA-256 on the provider.

How many redirect_uris can one client register?

The reference implementation in app/oidc/register/route.ts accepts between 1 and 10 redirect_uris per registration request.

Related guides

Continue exploring PROTEXT/0.1

Guide 01 · OIDC & OAuth 2.1

OpenID Connect & OAuth 2.1 PKCE Integration

Integrate Sign in with Protext using OpenID Connect Core discovery, OAuth 2.1 authorization code flow with S256 PKCE, RFC 9207 iss checks, and RS256 ID tokens.

Read guide →
Guide 03 · Browser SDK

Browser SDK (/sdk.js) & Declarative Form Autofill

Add Sign in with Protext to any web page using public/sdk.js: zero-secret PKCE S256 in the browser, data-protext form autofill, and protext:signed-in events.

Read guide →
Guide 09 · Federation & Self-Hosting

Self-Hosting a Protext Provider & Multi-Provider Discovery

Deploy your own MIT-licensed PROTEXT/0.1 provider with Next.js 15, Postgres, Drizzle, and PROTEXT_JWK, and implement /.well-known/protext.json multi-provider discovery.

Read guide →