Skip to content

feat(api): remember a person's OAuth consent, and let them list and revoke it - #3574

Merged
fforootd merged 22 commits into
mainfrom
claude/remembered-consent
Dec 2, 2026
Merged

fforootd merged 22 commits into
mainfrom
claude/remembered-consent

Conversation

@fforootd

@fforootd fforootd commented Dec 2, 2026 •

Copy link
Copy Markdown
Member

Context

Summary

A person who connected an agent was asked the same consent question every time it signed them in. The OAuth server now remembers the answer.

  • What is stored: one consent per person, client and API (resource), with the person's answer per offered scope (granted or declined), a digest of the client, the session, and a 90-day expiry that use does not renew.
  • A client whose identity is assured (a secret, or an https redirect that does not lead back to the person's device) skips the step when every requested scope was answered and at least one API scope granted. The code carries the granted scopes only.
  • A public client on the person's device (a loopback address in any spelling, localhost, a private-use scheme) sees the step every time, ticked as last answered, except that scopes with delete access start unticked. The server sets selected; the login component is unchanged.
  • The step is shown again for a new scope, a changed client, prompt=consent, or an expired consent. A consent given to a client whose registration has since changed counts as no consent: nothing is pre-ticked or carried over from it.
  • A scope that is never remembered always shows the step. That is every scope of an operation marked x-zitadel-returns-secret, and personal_access_token.create. A skip never leaves out a scope the request named, and never issues one of these. So a client that asks for every scope the metadata lists, as MCP clients do, sees the step at every sign-in, ticked as answered, until credential-returning operations have a scope of their own.
  • listMyConsents takes the session cookie or a person's token with user.read, so it is one more MCP tool (92 on a plain URL). revokeMyConsent is session-only, like revokeMySession, so one client's token cannot revoke another client's consent. Revoking ends all of that client's refresh grants and unredeemed codes for the person.
  • setUserPassword ends the person's consents, in the same transaction as the password write, as a revoke of each would: it is the only way a lost account is recovered today.
  • The existing sign-in and refresh integration tests now send prompt=consent, since they exercise the step itself.
  • Migrations: Postgres 000065/000066, Spanner 000070/000071, SQLite 000052/000053.

Validation

Run by the writing session on the tree of head 7c57e3c:

  • go test ./... in apps/api (the three TestBuildHTTPMux* in cmd/server fail there and on main: the console is not built in that container).
  • go test -tags sqlite_integration ./internal/api/integration_test/ ./internal/storage/stmttest/, and the same two packages with -tags postgres_integration against a local PostgreSQL 16.
  • go vet with the spanner tag. The Spanner lane was not run (no emulator).
  • node scripts/go-generate.mjs --check, check-openapi-rules, lint-openapi (pre-existing warnings only).
  • Each new behaviour has a test that fails without it; checked by disabling the skip, which fails the web-client subtests.
  • Not run: an end-to-end sign-in against a standalone local server with a real client document host. The integration tests run the whole HTTP path in-process (authorize, flow API, token, refresh, the me operations).

Release notes / changeset

  • .changeset/oauth-remembered-consent.md (@zitadel/server, @zitadel/api, minor): the OAuth server remembers consent for 90 days; web clients are asked once, clients on the person's device each time with the last answer ticked; a person lists and revokes their consents.

Notes

  • Reviewed independently at 3a2803745. The reviewer found no path where a skip issues a scope the person did not grant to that client, and no cross-user, cross-project or cross-API use of a consent. Its four findings are fixed, each with a test that fails without the fix: a changed client inherited the old client's answers; a code issued just before a revoke still bought a refresh token; two rules had no test; odd spellings of a loopback host counted as assured. Three design points it raised were decided by the owner and are built: the never-remembered scopes always show the step, delete scopes start unticked on the device, and a password reset ends consents.
  • Condition before the skip is switched on for the hosted cloud: a person must reach revoke from the Console; today only the API does. An ended session and a deleted client end no consent yet.
  • What a password set ends is a candidate for the policy work (ADR 066): not every customer will want an administrator's reset to end a user's consents and the clients' grants. Ending them is today's default.
  • Follows docs: decide remembered consent for OAuth clients #3573 (the ADR) and feat(api): end personal access tokens on a password set and ask a session for a recent sign-in #3570 (a password set ends personal access tokens), both merged. A password set now ends the person's tokens and their consents in one transaction; each step has a test that fails without it.
  • Open for review, recorded in the ADR: how long a consent lasts and whether use renews it (90 days without renewal until the policy work, as agreed for now); whether revoking a consent also revokes personal access tokens created through the client (ADR 095); consent events and delegation_id; keying by API rather than by the identifier the request named (the platform API has two).
  • Level with main as of feat(api): end personal access tokens on a password set and ask a session for a recent sign-in #3570.
  • Written in the session https://claude.ai/code/session_0137eGmUEzNb3SNs7Rj5USYf; this draft was opened by the coordinating session below.

https://claude.ai/code/session_0137eGmVSt2DgYJj2CjZbi1U


Generated by Claude Code

claude added 12 commits December 2, 2026 14:28
Amend ADR 082 (Proposed): a consent is remembered per person, client and
API. A client whose identity is assured (a secret, or an https answer)
skips the step for what it was granted; a client that returns to a
loopback address or a private-use scheme is asked each time with the
last choice ticked. Scopes of operations that return a credential are
never remembered. A person lists and revokes their consents, and a
revoke ends the client's refresh grants. ADR 092 points to it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0137eGmUEzNb3SNs7Rj5USYf
…rompt

A consents table in the three dialects, one row per person, client and
API (ADR 082, amendment of 2026-12-02): the scopes the person granted
and the ones they declined, a digest of the client, the session and time
of the last answer, and an expiry. Revoking one deletes it and the
client's refresh grants for the person in one transaction. The
authorization request keeps its prompt for the flow to read. stmttest
covers the statements on every dialect, and ADR 047 registers the
consent prefix.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0137eGmUEzNb3SNs7Rj5USYf
…o the policy work

A remembered consent holds the person's answer for every scope offered,
yes or no, so a client that asks for everything skips the step once the
person answered, and is issued the scopes answered yes. A scope that is
never remembered no longer forces the step: a skip does not issue it.
A declined scope is asked for again with prompt=consent after the API's
auth.scope_insufficient refusal. How long a consent lasts, and whether
use renews it, is left open for the policy work; the me operations
become two tools once #3559 lands.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0137eGmUEzNb3SNs7Rj5USYf
… with it

The consent step stores the person's answer, granted or declined per
scope offered (ADR 082, amendment of 2026-12-02). On the next request a
client whose identity is assured (a secret, or an https answer off the
person's device) skips the step when every scope asked was answered,
and its code carries the scopes answered yes. A client that holds no
secret and returns to a loopback address or a private-use scheme sees
the step each time, ticked as the person last answered. A new scope,
a changed client, prompt=consent or an expired consent shows the step.
Scopes of operations that return a credential are never remembered.
The authorization endpoint keeps the request's prompt for the flow.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0137eGmUEzNb3SNs7Rj5USYf
listMyConsents (GET /users/me/consents) lists what the signed-in person
consented to OAuth clients doing, the last answered first, with the
scopes granted and declined and when the consent expires.
revokeMyConsent (DELETE /users/me/consents/{consent_id}) deletes one
and ends every refresh token its client holds for the person, so the
client is asked again at its next sign-in (ADR 082, amendment of
2026-12-02). Both take the session cookie, like the other me
operations, so the MCP endpoint offers neither as a tool.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0137eGmUEzNb3SNs7Rj5USYf
The Enable OAuth guide says which clients are asked once and which every
time, and how a person lists and revokes a consent. ADR 082's amendment
says the me operations take the session cookie until #3559 lets them
take a person's token. The changeset covers the three code pieces.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0137eGmUEzNb3SNs7Rj5USYf
main renumbered the migrations (#3551) and marks a person's own
operations x-zitadel-self (#3559, #3560). listMyConsents takes the mark
and a person's token with user.read; revokeMyConsent takes the mark and
stays with the session cookie, as revokeMySession does. Generated files
regenerated.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0137eGmUEzNb3SNs7Rj5USYf
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0137eGmUEzNb3SNs7Rj5USYf
Amend ADR 082 (Proposed): a consent is remembered per person, client and
API. A client whose identity is assured (a secret, or an https answer)
skips the step for what it was granted; a client that returns to a
loopback address or a private-use scheme is asked each time with the
last choice ticked. Scopes of operations that return a credential are
never remembered. A person lists and revokes their consents, and a
revoke ends the client's refresh grants. ADR 092 points to it.

Co-Authored-By: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0137eGmUEzNb3SNs7Rj5USYf
…o the policy work

A remembered consent holds the person's answer for every scope offered,
yes or no, so a client that asks for everything skips the step once the
person answered, and is issued the scopes answered yes. A scope that is
never remembered no longer forces the step: a skip does not issue it.
A declined scope is asked for again with prompt=consent after the API's
auth.scope_insufficient refusal. How long a consent lasts, and whether
use renews it, is left open for the policy work; the me operations
become two tools once #3559 lands.

Co-Authored-By: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0137eGmUEzNb3SNs7Rj5USYf
Brings in main with personal access tokens (#3563), so PR 2 can stack on
the ADR's branch. A scope granted only on the consent step
(personal_access_token.create, domain.ConsentRequired) is never
remembered and always shows the step, to a first-party client too; the
ADR says so. Generated files regenerated; sets_test lists both the token
tools and listMyConsents.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0137eGmUEzNb3SNs7Rj5USYf
@vercel

vercel Bot commented Dec 2, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
cloud Ready Ready Preview Dec 2, 2026 7:39pm UTC

Request Review

fforootd commented Dec 2, 2026

Copy link
Copy Markdown
Member Author

The red Vercel (cloud) check is not caused by the code: @zitadel/cloud#migrate fails with relation "consents" already exists on this branch's own preview database, preview_claude_remembered_consent_687c4074.

Earlier pushes to this branch migrated that database when the consents migration was 000064. It is now 000066, after main's and #3563's migrations, so the database records version 64 as applied (the old consents table) and 66 collides. A fresh database migrates cleanly; the SQLite and Postgres integration lanes start from empty and pass.

Fix: drop that one preview database, as docs/runbooks/cloud.md describes ("One database by hand", on PlanetScale preview), and redeploy; the next build recreates, migrates and seeds it. That is a manual step on shared infrastructure, so it is left to someone with the preview migrator role.


Generated by Claude Code

@github-actions

github-actions Bot commented Dec 2, 2026 •

Copy link
Copy Markdown
Contributor

🦋 Changeset detected

Latest commit: 7c57e3c

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 27 packages
Name Type
@zitadel/server Minor
@zitadel/api Minor
@zitadel/cli Minor
@zitadel/components Minor
@zitadel/config Minor
@zitadel/sdk-angular Minor
@zitadel/sdk-core Minor
@zitadel/sdk-next Minor
@zitadel/sdk-nuxt Minor
@zitadel/sdk-qwik Minor
@zitadel/sdk-react Minor
@zitadel/sdk-solid Minor
@zitadel/sdk-svelte Minor
@zitadel/sdk-tanstack-start Minor
@zitadel/sdk-vue Minor
@zitadel/testing Minor
@zitadel/cloud Patch
@zitadel/client-sdk-contract Patch
@zitadel/sdk-qwik-router Minor
@zitadel/sdk-solid-start Minor
@zitadel/sdk-sveltekit Minor
@zitadel/server-sdk-contract Patch
@zitadel/server-darwin-arm64 Minor
@zitadel/server-darwin-x64 Minor
@zitadel/server-linux-arm64 Minor
@zitadel/server-linux-x64 Minor
@zitadel/server-win32-x64 Minor

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

…odes on revoke

From review of #3574:
- A consent given to a client before its document changed is no consent:
  its answers neither tick the step nor carry over into what the person
  answers the changed client.
- Revoking a consent also deletes the client's authorization requests for
  the person that hold an unredeemed code, in the same transaction on all
  three dialects, so a code issued before the revoke buys no token after.
- Only a redirect off the person's device assures a public client: a
  trailing dot, localhost subdomains, the unspecified address and numeric
  IPv4 forms (127.1, 2130706433, 0x7f.1) count as the device. The check
  is the consent rule's own; IsLoopbackOrigin is unchanged for its other
  callers.
- Tests for each, and for the first-party answer that stores nothing.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0137eGmUEzNb3SNs7Rj5USYf
…on the device, end consents on a password reset

The user's decisions on #3574's review (D1-D3):
- A request that names a scope a consent never remembers (one that
  returns a credential, or is granted only on the step) shows the step,
  ticked as answered: a skip never leaves out a scope the request named.
  An ask-everything client therefore sees the step at every sign-in; the
  ADR says so and leaves a scope of their own for those operations open,
  and no longer leans on prompt=consent as MCP's step-up.
- A client whose identity is not assured starts with no delete scope
  ticked, whatever the person answered before.
- setUserPassword, the reset by which a person gets back a lost account
  today, revokes every consent of theirs in the same transaction, with
  each client's refresh grants and unredeemed codes. The ADR records that
  a future self-service recovery must do the same, and a Console revoke
  surface as a condition before the skip is on for the hosted cloud.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0137eGmUEzNb3SNs7Rj5USYf
listMyConsents and revokeMyConsent are a person's own operations, on
their own credential (revoking on their session only); the CLI's
api-coverage test listed them as neither called nor explained.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0137eGmUEzNb3SNs7Rj5USYf
The amendment as the code's pull request now has it: a consent given to a client whose registration has changed counts as none; a revoke also ends the client's unredeemed codes; a request that names a scope that is never remembered always shows the step, so a client that asks for every listed scope is asked each time; delete scopes start unticked on the person's device; a password set ends the person's consents; and what a password set ends, like a consent's lifetime, is left to the policy work. A person reaching revoke from the Console is a condition before the skip is switched on for the hosted cloud.

The text was written in the session https://claude.ai/code/session_0137eGmUEzNb3SNs7Rj5USYf and is taken from its branch unchanged.

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

Brings in main at eaced99 (#3552, #3562, #3564). The CLI's api-coverage
test keeps only the two consent operations as not called: the personal
access token commands now call theirs.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0137eGmUEzNb3SNs7Rj5USYf
@fforootd
fforootd marked this pull request as ready for review December 2, 2026 19:25
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Dec 2, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
🔒 Security Review ✅ Completed 2026-12-02T19:43:18.947558Z 585d7e0 Draft marked ready
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

Base automatically changed from claude/remembered-consent-adr to main December 2, 2026 19:28
The ADR text it carries is on this branch through claude/remembered-consent-adr.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0137eGmUEzNb3SNs7Rj5USYf
Brings in #3570 (a password set ends personal access tokens). The consent
Spanner migrations sit behind its 000069 as 000070 and 000071.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0137eGmUEzNb3SNs7Rj5USYf
Copilot AI balanced review requested due to automatic review settings December 2, 2026 19:34
@fforootd
fforootd enabled auto-merge December 2, 2026 19:35
@fforootd
fforootd added this pull request to the merge queue Dec 2, 2026

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

Critical consent and revocation races can leave refresh grants active after revocation or restore declined scopes, and hosted-cloud consent skipping lacks the required Console revocation path.

6 open issues
What changed in this PR

Implements remembered OAuth consent from ADR 082 across the server, storage, and API clients.

Changes:

  • Stores scope choices for 90 days, with client-dependent skipping and preselection.
  • Adds consent listing, session-only revocation, and password-set cleanup.
  • Adds three-dialect migrations, regression tests, generated API support, and documentation.
File Description
packages/​go/​api/​oas_validators_gen.go Generates consent response validation.
packages/​go/​api/​oas_security_gen.go Adds consent operation authentication metadata.
packages/​go/​api/​oas_response_decoders_gen.go Decodes consent operation responses.
packages/​go/​api/​oas_parameters_gen.go Adds consent request parameters.
packages/​go/​api/​oas_operations_gen.go Registers consent operations.
packages/​go/​api/​oas_interfaces_gen.go Adds consent response interfaces.
docs/​adrs/​047-dialect-id-generation.md Registers the consent ID prefix.
apps/​docs/​content/​docs/​guides/​enable-oauth.mdx Explains remembered consent and revocation.
apps/​cli/​tests/​unit/​cli/​commands/​api-coverage.test.ts Documents CLI consent-operation exclusions.
apps/​api/​internal/​storage/​stmttest/​schema_nullability_test.go Checks new column nullability.
apps/​api/​internal/​storage/​stmttest/​consent_test.go Tests consent persistence and revocation.
apps/​api/​internal/​storage/​stmttest/​auth_request_test.go Tests prompt persistence.
apps/​api/​internal/​storage/​dialect/​sqlite/​statement.go Wires SQLite consent statements.
apps/​api/​internal/​storage/​dialect/​sqlite/​migration/​sql/​000053_consents.sql Adds SQLite consent storage and indexes.
apps/​api/​internal/​storage/​dialect/​sqlite/​migration/​sql/​000052_auth_request_prompt.sql Adds SQLite prompt storage.
apps/​api/​internal/​storage/​dialect/​sqlite/​consent.go Implements SQLite consent operations.
apps/​api/​internal/​storage/​dialect/​sqlite/​auth_request.go Persists authorization prompts in SQLite.
apps/​api/​internal/​storage/​dialect/​spanner/​statement.go Wires Spanner consent statements.
apps/​api/​internal/​storage/​dialect/​spanner/​migration/​sql/​000071_consents.sql Adds Spanner consent storage and indexes.
apps/​api/​internal/​storage/​dialect/​spanner/​migration/​sql/​000070_auth_request_prompt.sql Adds Spanner prompt storage.
apps/​api/​internal/​storage/​dialect/​spanner/​consent.go Implements Spanner consent operations.
apps/​api/​internal/​storage/​dialect/​spanner/​auth_request.go Persists authorization prompts in Spanner.
apps/​api/​internal/​storage/​dialect/​postgres/​statement.go Wires PostgreSQL consent statements.
apps/​api/​internal/​storage/​dialect/​postgres/​migration/​sql/​000066_consents.sql Adds PostgreSQL consent storage and indexes.
apps/​api/​internal/​storage/​dialect/​postgres/​migration/​sql/​000065_auth_request_prompt.sql Adds PostgreSQL prompt storage.
apps/​api/​internal/​storage/​dialect/​postgres/​consent.go Implements PostgreSQL consent operations.
apps/​api/​internal/​storage/​dialect/​postgres/​auth_request.go Persists authorization prompts in PostgreSQL.
apps/​api/​internal/​service/​user.go Ends consents when setting passwords.
apps/​api/​internal/​service/​statement.go Defines consent storage contracts.
apps/​api/​internal/​service/​mocks/​service.mock.go Generates consent statement mocks.
apps/​api/​internal/​service/​flow_engine.go Injects never-remembered scope lookup.
apps/​api/​internal/​service/​flow_auth_request.go Implements consent remembering and skip decisions.
apps/​api/​internal/​service/​flow_auth_request_test.go Extends consent service test fixtures.
apps/​api/​internal/​service/​flow_auth_request_remembered_test.go Tests remembered-consent rules.
apps/​api/​internal/​service/​consent.go Implements listing, revocation, and password cleanup.
apps/​api/​internal/​service/​consent_test.go Tests pagination and missing consents.
apps/​api/​internal/​service/​client_directory.go Computes client identity digests.
apps/​api/​internal/​service/​client_directory_test.go Tests client digest changes.
apps/​api/​internal/​oauth/​authorize.go Stores recognized prompt values.
apps/​api/​internal/​oauth/​authorize_test.go Tests prompt filtering and storage.
apps/​api/​internal/​mcp/​sets_test.go Includes consent listing in tool expectations.
apps/​api/​internal/​flowengine/​auth_request.go Supports remembered grants and preselection.
apps/​api/​internal/​flowengine/​auth_request_test.go Tests skipping and selected scopes.
apps/​api/​internal/​domain/​consent.go Defines consent lifetime and scope merging.
apps/​api/​internal/​domain/​consent_test.go Tests consent domain rules.
apps/​api/​internal/​domain/​auth_request.go Adds authorization prompt state.
apps/​api/​internal/​api/​security.go Registers consent authentication rules.
apps/​api/​internal/​api/​security_access_token_test.go Checks consent listing scope requirements.
apps/​api/​internal/​api/​scopes.go Finds credential-returning operation scopes.
apps/​api/​internal/​api/​scopes_test.go Tests never-remembered scope discovery.
apps/​api/​internal/​api/​integration_test/​oauth_sign_in_test.go Explicitly requests consent in existing tests.
apps/​api/​internal/​api/​integration_test/​oauth_remembered_consent_test.go Tests remembering, revocation, and password cleanup.
apps/​api/​internal/​api/​integration_test/​oauth_refresh_test.go Explicitly requests consent for refresh tests.
apps/​api/​internal/​api/​handler.go Initializes the consent service.
apps/​api/​internal/​api/​generated/​oas_validators_gen.go Generates server consent validation.
apps/​api/​internal/​api/​generated/​oas_unimplemented_gen.go Generates consent handler stubs.
apps/​api/​internal/​api/​generated/​oas_server_gen.go Extends the server handler contract.
apps/​api/​internal/​api/​generated/​oas_security_gen.go Generates consent security metadata.
apps/​api/​internal/​api/​generated/​oas_response_encoders_gen.go Encodes consent operation responses.
apps/​api/​internal/​api/​generated/​oas_parameters_gen.go Decodes consent request parameters.
apps/​api/​internal/​api/​generated/​oas_operations_gen.go Registers server consent operations.
apps/​api/​internal/​api/​generated/​oas_interfaces_gen.go Adds server consent response interfaces.
apps/​api/​internal/​api/​error_handler.go Routes consent domain errors.
apps/​api/​internal/​api/​consent.go Implements consent HTTP handlers.
apps/​api/​internal/​api/​authz_ungated_contract_internal_test.go Registers consent self-service operations.
apps/​api/​cmd/​server/​server.go Wires platform never-remembered scopes.
apps/​api/​api/​openapi/​openapi-spec.yaml Registers consent endpoint paths.
apps/​api/​api/​openapi/​endpoints/​users/​me/​consents/​methods.yaml Defines the consent listing contract.
apps/​api/​api/​openapi/​endpoints/​users/​me/​consents/​listMyConsents-error-response.yaml Generates listing error responses.
apps/​api/​api/​openapi/​endpoints/​users/​me/​consents/​list-my-consents-response.yaml Defines paginated consent responses.
apps/​api/​api/​openapi/​endpoints/​users/​me/​consents/​consent.yaml Defines the public consent schema.
apps/​api/​api/​openapi/​endpoints/​users/​me/​consents/​by_id/​revokeMyConsent-error-response.yaml Generates revocation error responses.
apps/​api/​api/​openapi/​endpoints/​users/​me/​consents/​by_id/​methods.yaml Defines session-only consent revocation.
apps/​api/​api/​openapi/​components/​schemas/​errors/​consent-not_found.yaml Generates the missing-consent error schema.
apps/​api/​api/​openapi/​components/​schemas/​consent-id.yaml Defines consent ID validation.
apps/​api/​api/​openapi/​components/​parameters/​consent-id.yaml Defines the consent path parameter.
apps/​api/​api/​openapi/​components/​examples/​errors/​consent-not_found.yaml Generates a missing-consent error example.
.changeset/​oauth-remembered-consent.md Adds customer-facing release notes.

Review effort: Balanced

Comment on lines +105 to +108
if assured && !promptsConsent(request.Prompt) && !slices.ContainsFunc(request.Scopes, never) {
if granted, ok := remembered.Answered(request.Scopes, never); ok {
consent.Remembered, consent.Granted = true, granted
return consent, nil
UserID: in.UserID,
ClientID: request.ClientID,
Resource: request.Resource,
ClientDigest: client.Digest,
Comment on lines +243 to +244
consent.Scopes, consent.Declined = domain.RememberConsent(previous, request.Scopes, in.Scopes, never)
if err := a.db.Statements().PutConsent(ctx, consent); err != nil {
Comment on lines +268 to +271
if in.Answered && request.CodeHash == "" {
if err := a.remember(ctx, in, request); err != nil {
return "", err
}
Comment on lines +34 to +38
`DELETE FROM zitadel_nextgen.refresh_grants AS g USING revoked AS r` +
` WHERE g.project_id = r.project_id AND g.user_id = r.user_id AND g.client_id = r.client_id` +
`), unredeemed AS (` +
`DELETE FROM zitadel_nextgen.auth_requests AS a USING revoked AS r` +
` WHERE a.project_id = r.project_id AND a.user_id = r.user_id AND a.client_id = r.client_id AND a.code_hash IS NOT NULL` +
Comment on lines +54 to +58
description: The session belongs to a different project than `project_id`.
content:
application/json:
schema:
$ref: ../../../../components/schemas/errors/sess-project_mismatch.yaml
@fforootd
fforootd marked this pull request as draft December 2, 2026 19:44
Merged via the queue into main with commit b53ae42 Dec 2, 2026
18 of 19 checks passed
@fforootd
fforootd deleted the claude/remembered-consent branch December 2, 2026 19:46
@github-project-automation github-project-automation Bot moved this from Inbox to Done in Engineering Kanban Dec 2, 2026
wim07101993 added a commit that referenced this pull request Dec 3, 2026
Resolve the overlap with remembered consent (#3574): keep main's prompt
column, stored space-separated, and move this branch's max_age and
login_hint migration after main's. A first-party client is asked for
consent on prompt=consent or a scope that always needs it, one rule
decides whether a client's identity is assured, and a live session
answers with a consent the person already gave.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

This branch was successfully deployed

1 active deployment
Preview — 7c57e3c5 Deployed Dec 2, 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