Skip to content

feat(api): name the hosts whose OAuth clients a server admits without registration - #3499

Merged
fforootd merged 92 commits into
mainfrom
claude/oauth-client-admission-policy
Dec 1, 2026
Merged

fforootd merged 92 commits into
mainfrom
claude/oauth-client-admission-policy

Conversation

@fforootd

@fforootd fforootd commented Dec 1, 2026 •

Copy link
Copy Markdown
Member

Context

Summary

An issuer that admits OAuth clients by their client ID metadata document admitted one from any host. A server can now name the hosts.

  • A new policy operation, auth.client.admit, with one setting: document_hosts, the hosts whose client documents are admitted. A host is spelled as a client ID spells it, in lower case and with :port only when the URL names one, and is matched whole: claude.ai does not admit sub.claude.ai. At most 64 hosts of at most 64 characters.
  • No policy, or one that sets nothing, admits a document from any host, as before. An empty list admits none.
  • Asked before the fetch. The client lookup asks the policy before it reads a document, so the server never contacts a host the policy does not name.
  • Asked again at every refresh, with the newest deployment to the token's issuer: a client whose host leaves the list is refused at its next refresh. Its grant is not deleted: it is answered again if the host returns to the list before the session ends. A sign-in under way when a release is deployed already ends there, whatever the policy says.
  • A code does not choose the policy. The deployment a code names is its sender's word until the code is redeemed, so a code exchange holds a client with a document to the policy of the project's newest primary deployment. A made-up code that names an older deployment has no document fetched that today's policy refuses.
  • The refusal names no host. The authorization endpoint answers 400 invalid_client and says that the server does not admit clients whose document that host serves; the token endpoint answers 401 invalid_client.
  • The platform project's policy comes from the server's settings. oauth.client_document_hosts (NEXTGEN_OAUTH_CLIENT_DOCUMENT_HOSTS, separated by commas) names the hosts, and the start deploys them with the platform's release, as it deploys the platform's other policies. Empty, the default, deploys no policy. A list no policy takes stops the start and names the setting.
  • The policy contract has the operation everywhere a policy appears: POST /policies, the policy reads, POST /policies/evaluate (input: the client_id a client would present; nothing is fetched), the .zitadel/policies/ file schemas, zitadel policy test, the Console's release view ("Client admission policy", "Admitted hosts") and the mock API.

No customer project's issuer admits client documents yet, so the policy takes effect on the platform project only. A policy file for it in a customer's project is accepted, stored and pinned, and changes nothing; the docs and the CLI's skill say so.

Validation

Run in apps/api unless noted. All passed, on the commit before the last one:

  • go vet ./..., and with -tags sqlite_integration on the integration packages
  • go test ./... -count=1
  • go test -tags sqlite_integration ./internal/api/integration_test/... ./internal/storage/stmttest/... ./internal/storage/dialect/sqlite/... ./internal/bootstrap/platform/ -count=1
  • Against a local PostgreSQL 16 (ZITADEL_TEST_POSTGRES_URL): go test -tags postgres_integration ./internal/api/integration_test/ ./internal/storage/stmttest/ ./internal/service/ -count=1
  • node scripts/go-lint.mjs, turbo run check-generate openapi --filter=@zitadel/server, node scripts/check-adrs-index.mjs, pnpm run check-openapi-rules and node scripts/check-changesets-status.mjs (repo root)
  • turbo run lint typecheck --filter=@zitadel/config --filter=@zitadel/cli --filter=@zitadel/console --filter=@zitadel/api-mock --filter=@zitadel/components --filter=@zitadel/docs and turbo run test --filter=@zitadel/config --filter=@zitadel/api-mock --filter=@zitadel/console (repo root), and the components' unit project
  • The CLI's unit suite (pnpm exec vitest run tests/unit in apps/cli, with a UTF-8 terminal): 10,094 of 10,095 run tests passed. The one that failed, auth-method sso enable "when the schema cannot be written", makes a file read-only and cannot fail that way as root, which the container runs as; this PR does not touch it.

The two commits after that changed where the server checks its host list (cmd/server) and merged the fixes of #3488 (a network fault on a document's host). After them: go test ./internal/service/ -count=1, and before the merge: node scripts/go-lint.mjs, go vet ./..., and go test ./cmd/... ./internal/service/ ./internal/policy/ ./internal/bootstrap/... -count=1.

TestOAuthClientAdmissionPolicy runs it over HTTP from end to end: a client signs in with no policy; a policy that names its host changes nothing for it; one that names another host refuses it at the authorization endpoint, refuses its refresh, and leaves a new document on that host unfetched; an empty list admits none; a policy that sets nothing admits it again; a dry run answers the same.

TestEnsureDeployedSQLiteDeploysTheClientAdmissionPolicy starts the platform bootstrap with a list of hosts, with another, and with none, and reads the policy the live release pins each time.

Against a local server. Built from this branch and started with zitadel start (NEXTGEN_OAUTH_ENABLED=true), with a client's document on a local TLS host the server was told to trust:

  • started with NEXTGEN_OAUTH_CLIENT_DOCUMENT_HOSTS naming that host: the authorization endpoint sends the client to the sign-in after one fetch of its document; the platform project holds the auth.client.admit policy with that host, its live release pins it, and the Console's release view shows "Client admission policy" with "Admitted hosts";
  • restarted with claude.ai,chatgpt.com: a new release is live with those hosts; the same client is answered 400 invalid_client, "this server does not admit clients whose document that host serves", with no host named, and its document is not fetched;
  • started with https://claude.ai: the server stops before it serves, and its log names oauth.client_document_hosts and says what an entry must look like.

Not run: the Spanner lane locally, the e2e lanes, and a real MCP client.

After an automated review, three more commits: a code exchange asks the current deployment's policy (TestOAuthClientAdmissionPolicy sends a made-up code that names an admitting deployment and expects 401 invalid_client and no fetch), the gate has a method of its own for that (CheckCurrent), so the flow operations keep their error lists, and the mock API keeps an explicit :443 as part of the host, as the server does. Run for them in apps/api: go vet ./..., go test ./... -count=1, go test -tags sqlite_integration ./internal/api/integration_test/ ./internal/api/integration_test/helpers/ ./internal/bootstrap/platform/ -count=1; and at the repo root turbo run lint --filter=@zitadel/server, which includes check-generate, and turbo run lint typecheck test --filter=@zitadel/api-mock.

Release notes / changeset

  • Changeset: .changeset/oauth-client-admission-policy.md — a server names the hosts whose OAuth clients it admits without registration, as the new auth.client.admit policy (@zitadel/server, @zitadel/api, @zitadel/config, @zitadel/cli)

Notes

  • Where the platform's policy comes from is a decision of this PR. The start rebuilds the platform project's release from what the server ships and its settings, so a policy published to that project through the API would be replaced at the next start. A server setting is the one place that lasts, as oauth.enabled is for the issuer itself.
  • The operation is named by the grammar alone. No event precedes admitting a client, so auth.client.admit follows area.resource.verb (ADR 066). The check runs where every lookup of such a client passes, not in the write path of auth.request.created: the token endpoint must ask too, and the fetch must wait for the answer.
  • Decided: a refused refresh pauses its grant and does not delete it. The grant waits for the host to return to the list or for its session to end, so a host removed by mistake costs nobody a sign-in. Signing out ends a grant, as before. The same holds for a disabled issuer in feat(api): keep an OAuth client connected with refresh tokens, and serve clients that hold no secret #3495.
  • Not built, from ADR 082 §9: whether a client that returns to a loopback address is admitted, and which scopes a client nobody vouched for may ask. A host is matched whole: no pattern admits its subdomains, and no setting names single document URLs.
  • A host over 64 characters cannot be listed, which is the bound the policy engine's cost estimate puts on any string. With a list set, a client on such a host is refused.
  • Each lookup of a client with a document now reads its deployment, release and policy revision: three reads at the authorization endpoint and at each refresh, and four at a code exchange, which also reads the project to find its current deployment. Nothing is cached yet.
  • New error code that reaches no API operation as an answer: clientdoc.not_admitted. It is the code of a refused dry run. The generator lists it on the flow operations, beside clientdoc.invalid.
  • A revoked release serves no client with a document, as it serves no declared client: the policy is resolved through the release, where such a client ignored its deployment before.
  • Seen in the local run, not changed here. The Console's release view ends a policy's document with "Edit the policy locally, then deploy". For the platform project's policies that is not how they change: the server's settings are.
  • deploy --dry-run and the file schema refuse an entry that is no host (a URL, upper case, a pattern), as POST /policies does. The policy template checks it once more for a release build and for the server's own setting.

https://claude.ai/code/session_0137eGmVSt2DgYJj2CjZbi1U


Generated by Claude Code

…ver follows

ADR 091, proposed. "MCP in Zitadel" is a local stdio server in the CLI,
/mcp on the platform project's issuer, and the MCP servers customers
build with Zitadel as their authorization server, built in order of
dependency.

It records that a tool is one operation generated from the operation
table, that the spec marks which operations only read, belong to
applications or return a credential, that an agent reads by default and
writes only in development, and that a destructive call needs the
person's confirmation for that call. The local server is experimental
and second to the CLI for an agent that has a shell; whether it ships
beyond that is an open question.

Co-Authored-By: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0137eGmVSt2DgYJj2CjZbi1U
…s in the spec

Three facts a client had to guess from a method or a name are now said
on the operation, beside x-zitadel-cli and x-zitadel-destructive:

- x-zitadel-read-only: a POST that changes nothing (the queries, the
  search, a policy evaluation, the invitation lookup).
- x-zitadel-plane: app: an operation an application's backend calls
  while a user signs in (auth attempts, session creation and exchange,
  passkey registration).
- x-zitadel-returns-secret: a response that carries a secret shown once
  or a token that signs a caller in.

The operation table carries them as readOnly, plane and returnsSecret,
and the CLI's Operation reads them. Only the bundled OpenAPI document
changes among the generated files.

Co-Authored-By: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0137eGmVSt2DgYJj2CjZbi1U
A port of the #2315 prototype to the current CLI, with the rules of
ADR 091. Experimental, and marked so in its help and in SKILL.md.

zitadel mcp is a stdio MCP server an MCP client starts. It serves one
tool per operation an operator calls, named by its operationId and typed
by the generated schemas, with the server and project secret every
project command resolves.

- Only read-only operations are tools unless --allow-writes, which is
  refused outside the development environment unless --dry-run is given.
- A tool that deletes, revokes or rolls back asks the person at the
  client first, and sends nothing when they decline, when the client
  cannot ask, or when a confirmation arrives for a call nothing asked
  about.
- An application-plane operation and one that returns a credential are
  never tools.
- stdout carries the protocol alone: --json and a run at a terminal are
  refused before the first byte.

The protocol library loads only when a session is served, so no other
command pays for it.

Not in this change: an integration spec for the command, a docs page on
connecting a client, and a telemetry dimension.

Co-Authored-By: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0137eGmVSt2DgYJj2CjZbi1U
This reverts commit efa4e84. The server already runs on a developer's
machine, so an MCP endpoint in the server is local too, and one
implementation then serves a local server, a self-hosted one and the
cloud with the rules enforced by the server. The CLI command only
mirrored API operations, which an agent with a shell already calls with
the api command.

The spec markers and the operation table fields stay.

Co-Authored-By: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0137eGmVSt2DgYJj2CjZbi1U
The Go server can mount a Model Context Protocol endpoint at /mcp
(ADR 091). Experimental and off by default: mcp.enabled turns it on.

- A tool is one operation of the API, read from the embedded OpenAPI
  document when the server starts. Its input schema is the spec's, with
  the component schemas it refers to in its own $defs.
- A tool call is the operation's own request, served in-process by the
  API's handler behind the whole middleware chain with the caller's
  bearer, so it is authenticated, authorized, validated, limited and
  logged as the same request over HTTP is.
- The credential is a project secret as the API takes it. A request
  without one is challenged with 401; a server that cannot check one
  answers 500, never 401.
- Only read-only operations are tools unless mcp.allow_writes is set.
  An application-plane operation and one that returns a credential are
  never tools.
- A tool that deletes, revokes or rolls back asks the person at the
  client first (multi round-trip requests), bound to that exact call by
  a state keyed with the credential. A client on a protocol revision
  before 2026-07-28 cannot be asked and is refused.
- Streamable HTTP without sessions, answering JSON. The library's
  loopback host check is off, since a reverse proxy on the same machine
  forwards under the public host name and the endpoint takes no ambient
  credential.

ADR 091 is rewritten around the endpoint, with the CLI stdio server as
a rejected alternative. Adds github.com/modelcontextprotocol/go-sdk
v1.9.0.

Co-Authored-By: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0137eGmVSt2DgYJj2CjZbi1U
… use

mcp.enabled now defaults to true; mcp.allow_writes stays false.

The endpoint opens nothing new: a caller needs the credential the API
takes, and reading only it offers less than the API does. A switch that
defaults to off would only keep agents out of servers whose operators
never heard of it.

So that a server no agent connects to pays nothing for it, the tools
are built on the first request that carries a credential the server
accepts, not at start: reading the embedded document and its schemas
takes about 50 ms. A request the server refuses never triggers the
build, and a document that cannot become tools fails this endpoint
with 500 while the API serves on.

Also tests that an id holding a slash stays inside its path segment,
against the fake API and over the real one.

Co-Authored-By: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0137eGmVSt2DgYJj2CjZbi1U
- The endpoint is on by default because it opens nothing, and costs a
  server nothing until it is used; off by default is a rejected
  alternative.
- Agent Skills through MCP's Skills extension
  (io.modelcontextprotocol/skills, SEP-2640) are wanted on the same
  endpoint: section 10, a step of the sequence, and an open question on
  which skills a server serves. Not built; the Go SDK at v1.9.0 does not
  carry the extension.

Co-Authored-By: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0137eGmVSt2DgYJj2CjZbi1U
…ts the spec backs

createInvitation returns a link that gives its role to whoever opens it, and
the link appears only in that response. It is now marked
x-zitadel-returns-secret, so the MCP endpoint no longer offers it and the link
cannot enter a model's context.

Every write that was not marked destructive carried destructiveHint false,
which the protocol defines as "only additive updates". An update, a password
change and a variable removal are not that. Every tool also carried
openWorldHint false. A write now carries a destructive hint only where the
spec marks it, and no open-world hint, so a client reads the protocol's
defaults. A read stays marked read-only and closed.

Co-Authored-By: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0137eGmVSt2DgYJj2CjZbi1U
…and four open questions in ADR 091

Reading by default narrows the tools, not the project secret the client
holds. The Skills extension can be built on the Go SDK's custom methods now.
The protocol deprecated dynamic client registration and has an MCP server
pass no token on, which asks whether /mcp and the management API are one
protected resource. Open questions added: createProjectClaim as a tool, the
audience, tool names, and a marker for writes that only add.

Co-Authored-By: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0137eGmVSt2DgYJj2CjZbi1U
The pieces a person's token on /mcp needs were built once in the closed
prototype #2451, are read against the epic in #2860, and public clients are
being built again in #3409.

Co-Authored-By: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0137eGmVSt2DgYJj2CjZbi1U
…place of a server switch

mcp.allow_writes is gone. One server holds many projects, so a switch on the
server was the wrong size, and it hid tools from a client that still held a
credential that writes.

Every operation already names the scopes it needs in the OpenAPI document, and
the API checks a credential against them. The endpoint now reads those scopes
and shows a client a tool only when its credential carries every scope of the
tool's operation, by the API's own rule (the security handler hands the
endpoint the credential with that rule). The list is narrowed per request;
authorization stays the API's, which refuses a call to a tool a client was not
shown as it refuses that request from anywhere.

A project secret carries every scope, so a client that holds one is now shown
all 76 tools, writes among them. A destructive call still asks the person at
the client first. The integration test creates a team through a tool and sees a
deactivation left unsent when nobody can be asked.

Co-Authored-By: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0137eGmVSt2DgYJj2CjZbi1U
Section 5 is rewritten: the scopes each operation names decide the list, a
project secret carries them all today, and who may write is decided where an
agent is connected. The server switch and a per-project setting join the
rejected alternatives, and a credential that only reads is an open question.

Co-Authored-By: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0137eGmVSt2DgYJj2CjZbi1U
The earlier wording said the API checks a credential against the scopes an
operation names. It does not: it authorizes by the credential's ceiling and
the caller's grants, and checks a scope only on an expand. ADR 091, the
configuration guide and the code comments now say so, and the ADR records as
an open question where the check belongs and which scopes in the spec are off.

Co-Authored-By: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0137eGmVSt2DgYJj2CjZbi1U
A tool's description was its summary with the method and path, such as
"Update a team: PATCH /teams/{team_id}.". A model reads the description and
not the title, and the summary only names the operation. The description is
now the first sentence of the operation's description, which the spec writes
to stand alone: "Renames an active team. API: PATCH /teams/{team_id}.". The
question a destructive call asks the person carries the same sentence, so it
says what will happen and not only the operation's name.

The seven query tools take their page token in the body and had no paging
hint; they now carry one that says so.

Co-Authored-By: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0137eGmVSt2DgYJj2CjZbi1U
A summary is an MCP tool's title, an API reference page's title and the
generated clients' doc comment. Eight still named an operation as it was
called before the renames of #3007, so a tool named deleteGrant was titled
"Revoke a grant" and one named listVariables "Get a project's variables".
They now open with the verb of their operationId, and a test in the MCP
package holds that for every tool. search is "Search resources": it searches
the resources of projects, not the projects.

getUserPasswordState declared its user_id inline and without a description;
it now refers to the shared parameter, as setUserPassword on the same path
does.

Co-Authored-By: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0137eGmVSt2DgYJj2CjZbi1U
A tool takes its name, title and description from the spec. The API checks a
scope for an expand and for the kinds in a release bundle, and nowhere else.
The open questions now say which scope and name oddities are deliberate, which
break a written rule, and add buildRelease's weight and createDeployment's
missing question.

Co-Authored-By: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0137eGmVSt2DgYJj2CjZbi1U
…too heavy

Every session carries the whole tool list in the agent's context. buildRelease
was 35,000 bytes of it, more than a fifth, because its input repeats the
schema of every kind of config. It also takes the files of .zitadel/ as
written on disk, which an agent with a shell sends with the CLI.

One tool may now weigh 16,000 bytes at most. An operation whose tool would
weigh more stays an operation of the API and is not a tool, and a test names
each one, so the next to grow past the budget is dropped by a decision. The
list is 75 tools and 124,000 bytes, held under 130,000.

The confirmation texts no longer list delete, revoke and roll back, since a
deployment asks as well.

Co-Authored-By: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0137eGmVSt2DgYJj2CjZbi1U
Both replace what a project serves. A rollback asked before it was sent and a
deployment did not. The MCP endpoint now asks the person at the client before
a deployment, @zitadel/api lists it among destructiveOperations, and
`zitadel api createDeployment` asks first, so without a terminal it needs
--force. `zitadel deploy`, `deployment create` and `preview` are unchanged:
they already ask on their own terms.

Co-Authored-By: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0137eGmVSt2DgYJj2CjZbi1U
A project secret carries project.write and project.read, and the API reads
project.write as every scope. ADR 091 and the configuration guide said it
carries every scope. The ADR's scope question also names the removals that
stay on a write scope as what they are: deliberate, and open in the gate
contract test.

Co-Authored-By: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0137eGmVSt2DgYJj2CjZbi1U
The tools are the operations of the v1 contract, so the endpoint carries that
contract's prefix (ADR 077 §3). A proxy or an edge that routes the API by its
prefix routes the endpoint with it: the cloud already sends /api/ to the
server, so it needs no routing rule, and /mcp at the root stays the website's.

The server's console path check no longer reserves the endpoint's path, which
is the API's now. ADR 091 records the root path as a rejected alternative,
drops two sentences the scopes change and the removed reads-only default left
stale, and notes which TypeScript SDK line speaks the revision a destructive
call's confirmation needs.

Co-Authored-By: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0137eGmVSt2DgYJj2CjZbi1U
…ts scopes

With oauth.enabled the management API takes an access token the platform
project's issuer signed for a person (ADR 036, amendment of 2026-11-25). The
person is the principal, with the grants their Console session has, on the
operations a Console session may call. The token's scopes are a ceiling on
them and never a grant: an operation that names a scope the token was not
issued with answers 403 auth.scope_insufficient, and project.write is one
scope among the others, not the umbrella it is for a project secret. Where a
session's grants waive a scope on an expanded read, a token still needs the
scope. The two secrets keep the rule they had.

The verifier checks the signature against the platform project's own keys,
the type, the issuer and the expiry, and that the session the token names is
active and its subject's, so a token ends when its session does. A token
issued for the MCP endpoint is taken only on the calls the endpoint makes,
so its holder cannot call an operation the endpoint offers no tool for. The
endpoint shows a person's token the tools its scopes cover among the
operations the API takes it on.

Nothing issues such a token yet: the token endpoint still signs for the
client as audience and drops every scope.

Co-Authored-By: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0137eGmVSt2DgYJj2CjZbi1U
… session

The platform project's issuer signs tokens for the server's own API. An
authorization request names the API with resource (RFC 8707), by the API's
URL or the MCP endpoint's, and asks for scopes the API's document declares.
The request is stored with both, and the token its code buys carries the
resource as its audience, the scopes, and the session it was issued in,
which the API checks on every call. A request without a resource gets what
it got: a token for its client, with no scope and no session claim.

A resource the issuer has no API for is refused with invalid_target, which
for a customer project's issuer is every resource, and a scope the API does
not define with invalid_scope. Both go back to the client before anyone
signs in. OpenID Connect's scopes are ignored, as before.

The authorization requests table gains a nullable resource column in the
three dialects.

Co-Authored-By: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0137eGmVSt2DgYJj2CjZbi1U
…th the read scope

The MCP endpoint is an OAuth protected resource when the platform project's
issuer signs tokens for it. It serves its metadata (RFC 9728) at
/.well-known/oauth-protected-resource/api/v1/mcp, ahead of the OAuth server's
well-known subtree, and names it in the challenge of a 401. The metadata
names the issuer and the scopes a person's token can be used for: those of
the operations that take such a token.

Three reads a person's token reaches name project.write, which guards them
from the preview secret until the credential planes split: getProject,
listProjectMembers and search. A person's token reads them with
project.read, as the permission catalog has it for an operator, and that
scope writes nothing. A test holds the list to the spec.

The endpoint asks the API one question about a credential, whether it covers
an operation, where it asked two. ADR 091 and the permission catalog say what
is checked now, and what still keeps a client from signing a person in.

Co-Authored-By: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0137eGmVSt2DgYJj2CjZbi1U
The playground test opens deleteGrant by its page title, which the spec's
summary sets. The summary became "Delete a grant" on this branch, so the
deployment check of the docs no longer found the page.

Co-Authored-By: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0137eGmVSt2DgYJj2CjZbi1U
…r consent first

A flow started with auth_request_id now ends in the redirect that carries
the code to the client (ADR 081 §8 and §9), and the engine puts a consent
step before it for a client that is not the project's own (§11).

- POST /flows opens a flow for a request only from the browser that holds
  the request's binding cookie, on the issuer's origin, while the request is
  open, and against the deployment it resolved. Anything else answers
  flow.auth_request_invalid. On a secure origin only the __Host- cookie is
  read.
- The code is issued after the handoff, which is what proves the sign-in
  complete, and is bound to the flow's session: it buys a token only once
  the browser exchanged the handoff.
- The consent step is the engine's. No definition holds it, and consent and
  account_choice are reserved step names. It is asked of a person who has
  proven who they are, on every request, and carries the client's name, the
  host its answer goes to, the API and the scopes. Accepting continues to
  the code. Denying returns access_denied, signs nobody in and spends the
  request.
- The platform project's issuer sends the browser to the Console's sign-in
  page.
- A client that is asked for consent anyway may send prompt=consent.

TestOAuthSignInFromTheAuthorizationEndpointToAToken runs the authorization
code flow over HTTP from the authorization endpoint to the token endpoint.

Co-Authored-By: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0137eGmVSt2DgYJj2CjZbi1U
…with its consent screen

The login page the authorization endpoint sends a browser to has the
request's handle in its auth_request parameter.

- <zitadel-login> reads the handle from the page URL and sends it with the
  flow it starts, also when it restarts one.
- It renders the consent step with its built-in template whatever the
  project's branding says: the client's name, the host its answer goes to,
  the API and one line per scope, worded by consent.scope.<scope> in locales
  or else the scope itself. Focus goes to that summary, never to a button,
  so the Enter that sent the password allows nothing.
- On the redirect that answers the request it exchanges the handoff first,
  since the code buys a token only once the session holds the sign-in. A
  refusal carries no handoff and is followed at once. A redirect of a flow
  for no request is unchanged.
- The Console's /login keeps the handle and shows the sign-in to someone it
  already knows too, where it used to send them on.
- The centered branding design stays the bundled template's copy.

Co-Authored-By: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0137eGmVSt2DgYJj2CjZbi1U
…project's template places

From the frontend review of the sign-in that answers an authorization request.

The consent step was the one step rendered by the built-in template whatever
a project's branding said, with its markup and styles in the template and
the shared stylesheet. It is now a step like any other:

- `<zl-consent>` is an atom, with a manifest entry, a story under the
  accessibility gate and its own styles. The built-in template and both
  ejectable designs place it above the step's two answers.
- A template that renders no summary gets it back before its first button,
  by the safety net that puts back a required field: nobody is asked to
  allow a client they are not shown.
- `consent.title` names the client through `{client}`, which the page fills
  in from the step, so a template that greets the visitor in every title
  needs no switch for this step.
- The handoff is exchanged before the browser leaves by one helper, shared
  by the answer to an authorization request and `post-sign-in-url`.

The mock API learns both ends of it: a test opens a request with
`openAuthRequest(...)`, and a flow started with its handle passes through
the `consent` step and ends in the client's redirect. The component's spec
drives that mock in place of handlers of its own, and the focus test runs in
the browser project.

Co-Authored-By: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0137eGmVSt2DgYJj2CjZbi1U
… verb of their names

`main` added `createTeamMembership` and `deleteTeamMembership`, titled "Add a
user to a team" and "Remove a member from a team". An MCP client shows a
person the summary and a model the `operationId`, and a test of the endpoint
holds that the two open with the same verb. They are now "Create a team
membership" and "Delete a team membership"; their descriptions keep the
words a reader looks for.

With them the endpoint offers 76 tools, about 127,000 bytes of the 130,000
its list may weigh.

Co-Authored-By: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0137eGmVSt2DgYJj2CjZbi1U
Both take a bearer and a session cookie, so their error lists gain
`auth.scope_insufficient`, as every such operation's does on this branch.

Co-Authored-By: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0137eGmVSt2DgYJj2CjZbi1U
…tokens

# Conflicts:
#	docs/design/api/events-catalog.md
#	packages/components/custom-elements.json
…en-scope-checks

The consent step's summary became the `<zl-consent>` atom below this branch,
so what this branch adds to it moves into the atom: the host that serves an
unregistered client's document (`document-host`) and the warning under an
answer that goes to the visitor's own device (`loopback-warning`). The three
templates, the safety net, the mock API's request and the specs follow.

Co-Authored-By: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0137eGmVSt2DgYJj2CjZbi1U
@fforootd
fforootd added this pull request to the merge queue Dec 1, 2026
@github-merge-queue
github-merge-queue Bot removed this pull request from the merge queue due to a conflict with the base branch Dec 1, 2026
Base automatically changed from claude/policy-list-settings to main December 1, 2026 20:44
…-admission-policy

Brings in the cold-start flake fixes from main.

Co-Authored-By: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0137eGmVSt2DgYJj2CjZbi1U
The five pull requests below this one landed on main as squash commits.
main's tree equals what this branch already holds of them, merged with
the previous main (checked: the trees match), so this merge keeps the
branch's tree and only records main as merged. What remains against
main is this pull request's own change.

Co-Authored-By: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0137eGmVSt2DgYJj2CjZbi1U
GitHub's code scanning did not register the JavaScript analysis of the
previous commit, although the analysis ran and its upload completed, and
a default-setup scan cannot be re-run. This commit changes nothing; it
only gives the scan a new commit to report on.

Co-Authored-By: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0137eGmVSt2DgYJj2CjZbi1U
@fforootd
fforootd enabled stacked auto-merge December 1, 2026 21:20
@fforootd
fforootd added this pull request to the merge queue Dec 1, 2026
Merged via the queue into main with commit 2f905c6 Dec 1, 2026
17 checks passed
@fforootd
fforootd deleted the claude/oauth-client-admission-policy branch December 1, 2026 21:26
@github-project-automation github-project-automation Bot moved this from Inbox to Done in Engineering Kanban Dec 1, 2026
fforootd pushed a commit that referenced this pull request Dec 1, 2026
…ecorder

Picks up main, which gained the client admission policy (#3499). Its
deployment resolver still answers the instance alone, so it takes the
instance from the resolved policy, and the dry run's resolver keeps both
methods. The client admission gate evaluates as on main and records no
decision yet.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0137eGmURNCsyVFcQC2EKSU6
fforootd pushed a commit that referenced this pull request Dec 1, 2026
Picks up main, with #3505 and the client admission policy (#3499).

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0137eGmURNCsyVFcQC2EKSU6

This branch was successfully deployed

1 active deployment
Preview — 8c431b65 Deployed Dec 1, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

3 participants