Skip to content

feat(console): list connected apps on the profile and revoke them - #3623

Merged
fforootd merged 2 commits into
mainfrom
claude/console-connected-apps
Dec 3, 2026
Merged

fforootd merged 2 commits into
mainfrom
claude/console-connected-apps

Conversation

@fforootd

@fforootd fforootd commented Dec 3, 2026 •

Copy link
Copy Markdown
Member

Context

Summary

  • The console's profile (/account, opened from the account menu) gets a Connected apps section after Sign-in methods. It lists every app or agent the person allowed to act for them, one row per client however many APIs it asked for:
    • the client, named by the host of its client metadata document as the consent screen named it (the whole URL shows on hover), or by its client ID;
    • the scopes they granted across its consents, wrapped rather than clipped, or "No scopes";
    • when they first allowed it;
    • "Created N personal access token(s)" when the app created PATs that still work (a PAT's record names the client that created it).
  • Revoke opens a confirmation ("Keep access" / "Revoke access") that explains the effect: the app can no longer renew its access and has to ask again at its next sign-in, and an access token it already holds stops working within minutes. The dialog names the PATs it created, which are revoked with it, or says when the PATs could not be read. On confirm it deletes each of those PATs (DELETE /users/me/personal_access_tokens/{id}), then each of the app's consents (DELETE /users/me/consents/{id}, which ends the client's refresh tokens), then reloads the list. PATs go first, so a failure leaves the app listed and Revoke can be retried; a 404 counts as already revoked.
  • Empty state: "You have not allowed any app to act for you." A failed read shows "Could not be loaded" and the rest of the profile still renders, as passkeys and linked accounts already do. A person homed outside the platform project holds no PATs; their tkn.pat_owner_not_platform answer reads as none.
  • The view is a section on the existing profile, not a new route, so navigation and search do not change. The new code lives in apps/console/src/features/consents/ (model.ts, api.ts, components/connected-apps.tsx). It reuses ConfirmDialog and the sign-in method row styles; the console's API client adds the CSRF header to the DELETEs.

Validation

  • pnpm exec biome check apps/console/src: clean.
  • tsc --noEmit -p apps/console: passes.
  • pnpm exec vitest run src/routes/_authed/account src/features/consents: 27 passed. The specs cover:
    • listing by host and by client ID, with the scopes;
    • grouping a client's consents for two APIs into one app, with the union of scopes, the earliest date and only its live PATs;
    • the empty state and a failed read;
    • revoking an app with two consents and a PAT after confirming: the PAT, then both consents, are deleted and the list reloads;
    • the dialog when the PATs could not be read;
    • "Keep access" (nothing is sent).
  • pnpm exec vitest run in apps/console: 72 files, 1201 tests passed.
  • node scripts/check-pr-title.mjs --title "feat(console): list connected apps on the profile and revoke them": ok.

Release notes / changeset

  • Changeset: .changeset/console-connected-apps.md (@zitadel/server, minor). The console's profile lists Connected apps, each once with the scopes granted, when, and the PATs it created. Revoke asks first, then ends all of that app's access, and the app has to ask again at its next sign-in.

Notes

  • Revoke uses the session alone, as revokeMyConsent requires. It does not re-prove a credential; whether revoking should ask for one is part of the consent policy follow-up already noted.
  • Revoking an app's PATs happens in the Console, not in revokeMyConsent. Should the server end them with the consent too, for every caller? That is a server change worth deciding separately.
  • A follow-up could offer the same list to a customer's own users in the customer's app. The proxy already forwards /users/me/consents, so that is an SDK helper and docs, not a server change.

https://claude.ai/code/session_0137eGmVSt2DgYJj2CjZbi1U


Generated by Claude Code

The profile gets a Connected apps section that reads the person's consents
(GET /users/me/consents) and shows each client by the host of its client
document, or by its client ID, with the scopes granted and when. Revoke asks
first, then calls DELETE /users/me/consents/{id}, which ends the client's
refresh tokens, and reloads the list. A failed read says so and keeps the
rest of the profile.

Co-Authored-By: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0137eGmVSt2DgYJj2CjZbi1U
Copilot AI balanced review requested due to automatic review settings December 3, 2026 14:24
@vercel

vercel Bot commented Dec 3, 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 3, 2026 2:38pm UTC

Request Review

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

Revocation messaging overstates its effect because other resource consents and personal access tokens remain active, while truncated scope lists prevent users from inspecting all granted permissions.

3 open issues
What changed in this PR

Adds Connected apps to the console profile, using the existing consent APIs to list approvals and revoke access after confirmation.

Changes:

  • Displays client names, granted scopes, and approval dates, with empty and error states.
  • Adds confirmed revocation and refreshes the list afterward.
  • Adds tests, shared mocks, and a server changeset.
File Description
apps/​console/​src/​test/​msw.ts Defaults consent requests to an empty list.
apps/​console/​src/​routes/​_authed/​account/​profile.spec.tsx Tests listing, errors, confirmation, and cancellation.
apps/​console/​src/​routes/​_authed/​account/​index.tsx Loads consents and renders Connected apps.
apps/​console/​src/​features/​consents/​model.ts Defines the consent type and client labels.
apps/​console/​src/​features/​consents/​model.spec.ts Tests client-label formatting.
apps/​console/​src/​features/​consents/​components/​connected-apps.tsx Implements consent rows and revocation confirmation.
apps/​console/​src/​features/​consents/​api.ts Adds paginated reads and revocation calls.
.changeset/​console-connected-apps.md Records the feature for release notes.

Review effort: Balanced

One row per client: an app allowed for two APIs held two consents, and
Revoke ended one, so the other skipped consent at its next sign-in. Revoke
now ends each of the app's consents and the personal access tokens it
created, which outlive a consent; the dialog names them, and says so when
they could not be read. Scopes wrap instead of being clipped.

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 3, 2026
Merged via the queue into main with commit c7c4229 Dec 3, 2026
16 checks passed
@fforootd
fforootd deleted the claude/console-connected-apps branch December 3, 2026 16:48

This branch was successfully deployed

1 active deployment
Preview — 2091fca3 Deployed Dec 3, 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

None yet

Development

Successfully merging this pull request may close these issues.

3 participants