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.
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)
| Field | Requirement | Validation & behavior |
|---|---|---|
| client_name | Required | String trimmed to 2–80 characters; displayed on the consent screen |
| redirect_uris | Required (1–10 items) | Must be https:// or loopback http://localhost / http://127.0.0.1 with no # fragment |
| token_endpoint_auth_method | Optional (default: none) | "none" creates a public PKCE client; any other value creates a confidential client with a 32-byte secret |
| client_uri | Optional | Must start with https:// if provided |
| logo_uri | Optional | Must start with https:// if provided |
| Response (HTTP 201) | JSON, Cache-Control: no-store | Returns client_id (px_*), optional client_secret, redirect_uris, grant_types, response_types, and endpoint URLs |
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.
Verify against the normative specification or register your client.
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.
Continue exploring PROTEXT/0.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 →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 →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 →