Repository navigation
feat: add rp-initiated logout (end_session_endpoint) - #3196
Conversation
|
Warning Review limit reached
Next review available in: 48 minutes Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available. How can I continue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews. How do review limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability. For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window. Please refer docs for additional details. Review details⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (29)
📝 WalkthroughWalkthroughAdds OIDC RP-Initiated Logout support: a new ChangesRP-Initiated Logout Implementation
Estimated code review effort: 4 (Complex) | ~60 minutes Sequence Diagram(s)sequenceDiagram
participant Browser
participant LogoutController
participant OAuth2EndSessionService
participant SessionManager
Browser->>LogoutController: GET/POST /logout (id_token_hint, client_id, post_logout_redirect_uri, state)
LogoutController->>OAuth2EndSessionService: verify(request)
OAuth2EndSessionService-->>LogoutController: hintVerified, sub, sessionId, redirectUri
alt hintVerified and identifiers present
LogoutController->>OAuth2EndSessionService: revoke(sessionId, sub, subKind)
OAuth2EndSessionService->>SessionManager: revoke(sessionId)
end
alt redirectUri validated
LogoutController-->>Browser: redirect to redirectUri (with state)
else
LogoutController-->>Browser: render logout UI page
end
Possibly related PRs
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Pull request overview
Adds OIDC RP-Initiated Logout support to Authup by introducing a public end_session_endpoint (GET/POST /logout) that can verify id_token_hint, revoke the referenced session (when safe), and optionally redirect back to a validated client URL. This fits into the OAuth2/OIDC surface area by completing the session-binding/logout story alongside the discovery metadata and client kit helpers.
Changes:
- Advertise and implement
end_session_endpoint(/logout) with SSR UI + controller wiring and coreOAuth2EndSessionService. - Extend token verification to optionally ignore
expfor logout-hint verification, while retaining signature/nbf validation. - Add client-web-kit URL builder + workflow component and add i18n strings for logout UX.
Reviewed changes
Copilot reviewed 28 out of 28 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| packages/specs/src/openid/type.ts | Extends OpenID provider metadata type to include end_session_endpoint. |
| packages/server-kit/src/crypto/json-web-token/verify/module.ts | Adds ignoreExpiry option to allow skipping exp validation when verifying logout hints. |
| packages/i18n/src/constants.ts | Introduces new client-facing translation keys for logout UI. |
| packages/i18n/src/catalogs/fr/client.ts | Adds French translations for logout UI strings. |
| packages/i18n/src/catalogs/es/client.ts | Adds Spanish translations for logout UI strings. |
| packages/i18n/src/catalogs/en/client.ts | Adds English translations for logout UI strings. |
| packages/i18n/src/catalogs/de/client.ts | Adds German translations for logout UI strings. |
| packages/client-web-kit/src/core/oauth2/authorization-request.ts | Adds buildEndSessionURL() helper for constructing RP-initiated logout URLs. |
| packages/client-web-kit/src/components/workflows/index.ts | Exports the new end-session workflow. |
| packages/client-web-kit/src/components/workflows/end-session/index.ts | Adds workflow barrel export for AEndSessionForm. |
| packages/client-web-kit/src/components/workflows/end-session/AEndSessionForm.vue | Adds logout confirmation/done UI and local-store logout action. |
| apps/server-core/ui/src/pages/logout.vue | Adds SSR page that hosts the end-session form. |
| apps/server-core/ui/src/app.ts | Registers /logout UI route in the SSR router. |
| apps/server-core/test/unit/http/controllers/entities/realm-openid.spec.ts | Tests discovery advertises end_session_endpoint. |
| apps/server-core/test/unit/core/oauth2/end-session/service.spec.ts | Adds unit test matrix for end-session verify/revoke and redirect validation behavior. |
| apps/server-core/src/core/oauth2/token/verifier/types.ts | Extends verifier options with ignoreExpiry. |
| apps/server-core/src/core/oauth2/token/verifier/module.ts | Threads ignoreExpiry down into server-kit verifyToken. |
| apps/server-core/src/core/oauth2/index.ts | Exports the new end-session module from oauth2 core index. |
| apps/server-core/src/core/oauth2/end-session/types.ts | Defines request/result types and service interface for end-session logic. |
| apps/server-core/src/core/oauth2/end-session/service.ts | Implements hint verification, redirect validation, and safe session revocation. |
| apps/server-core/src/core/oauth2/end-session/index.ts | Adds end-session module barrel exports. |
| apps/server-core/src/app/modules/http/modules/controller.ts | Wires LogoutController and OAuth2EndSessionService into the HTTP module container. |
| apps/server-core/src/adapters/http/controllers/workflows/logout/types.ts | Defines logout controller context/options types. |
| apps/server-core/src/adapters/http/controllers/workflows/logout/module.ts | Implements /logout GET/POST controller behavior (verify → revoke → redirect/SSR). |
| apps/server-core/src/adapters/http/controllers/workflows/logout/index.ts | Adds barrel exports for logout controller. |
| apps/server-core/src/adapters/http/controllers/workflows/index.ts | Exports logout workflow controller module. |
| apps/server-core/src/adapters/http/controllers/entities/realm/module.ts | Adds end_session_endpoint to realm discovery response. |
| .agents/architecture.md | Documents RP-initiated logout design, security posture, and residual behavior. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
c2fa21c to
9421447
Compare
6f3cd92 to
602d0f8
Compare
authup
@authup/client-web
@authup/server-core
@authup/access
@authup/client-web-kit
@authup/client-web-kit-theme
@authup/client-web-nuxt
@authup/client-web-theme
@authup/core-http-kit
@authup/core-kit
@authup/core-realtime-kit
@authup/errors
@authup/i18n
@authup/kit
@authup/server-adapter-kit
@authup/server-adapter-node
@authup/server-adapter-socket-io
@authup/server-adapter-web
@authup/server-kit
@authup/server-test-kit
@authup/specs
commit: |
9421447 to
675eecf
Compare
602d0f8 to
5a5e82e
Compare
9449782 to
a708faa
Compare
|
@coderabbitai full review |
✅ Action performedFull review finished. Your plan includes PR reviews subject to rate limits. More reviews will be available in 2 minutes. |
|
@coderabbitai full review |
✅ Action performedFull review finished. Your plan includes PR reviews subject to rate limits. More reviews will be available in 42 seconds. |
|
@coderabbitai full review |
✅ Action performedFull review finished. |
There was a problem hiding this comment.
Actionable comments posted: 2
🧹 Nitpick comments (6)
packages/client-web-kit/src/core/oauth2/authorization-request.ts (2)
107-142: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick winNo unit tests for the new helper.
buildEndSessionURLhas no accompanying spec despite being a new public export with several conditional branches (encoding, trailing-slash trimming, optional query params).🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@packages/client-web-kit/src/core/oauth2/authorization-request.ts` around lines 107 - 142, Add unit tests for buildEndSessionURL to cover the new public helper’s behavior: verify trailing slashes are trimmed from baseURL, each optional field in BuildEndSessionURLContext is included only when present, and URLSearchParams encoding is applied correctly for query values. Place the tests alongside the authorization-request helpers so the different branches in buildEndSessionURL are exercised and future regressions are caught.
120-142: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low valueConsider accepting the endpoint path/URL directly instead of hardcoding
/logout.
buildEndSessionURLalways appends/logouttobaseURL, coupling this client helper to the exact server route path. If the discovery-providedend_session_endpointever diverges from${baseURL}/logout(e.g., per-realm path segments), this helper would silently build an incorrect URL with no compile-time signal.🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@packages/client-web-kit/src/core/oauth2/authorization-request.ts` around lines 120 - 142, buildEndSessionURL is hardcoding the logout route by appending /logout to baseURL, which makes it too tightly coupled to one server path. Update buildEndSessionURL to accept and use the end-session endpoint URL/path directly from BuildEndSessionURLContext (or derive it from discovery input) instead of constructing it from baseURL, while keeping the existing query parameter assembly for idTokenHint, clientId, postLogoutRedirectUri, state, and realmId.apps/server-core/src/adapters/http/controllers/workflows/logout/module.ts (1)
44-67: 🔒 Security & Privacy | 🔵 TrivialPublic, unauthenticated JWT-verification endpoint — consider rate limiting.
handle()performs signature verification on an arbitrary attacker-suppliedid_token_hinton every request to this public, unauthenticated endpoint. This is spec-compliant (OIDC RP-Initiated Logout), but as with any public endpoint doing crypto verification of client-supplied tokens, it's worth ensuring upstream rate limiting/backoff exists to mitigate verification-cost DoS.🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@apps/server-core/src/adapters/http/controllers/workflows/logout/module.ts` around lines 44 - 67, The public logout endpoint handled by handle() in the logout controller performs JWT signature verification on attacker-supplied id_token_hint values, so add or confirm upstream rate limiting/backoff for this route to reduce verification-cost DoS risk. Keep the OIDC RP-Initiated Logout behavior intact, and ensure the protection is applied around the endpoint exposed by this controller and its endSessionService.verify call path.apps/server-core/src/core/oauth2/end-session/service.ts (1)
44-72: 🩺 Stability & Availability | 🔵 Trivial | ⚡ Quick winSwallowed exceptions hide infra failures from validation failures.
The
catch {}block treats every failure the same way — a forged signature and a JWKS-fetch/network error both silently result inhintVerified = false. That's safe by design, but it removes any observability into whether verification failed due to an actual bad hint vs. a transient dependency issue, which matters for a security-sensitive revoke path.♻️ Suggested logging addition
- } catch { - // forged / unverifiable hint → stays unverified (no revoke) - } + } catch (err) { + // forged / unverifiable hint → stays unverified (no revoke) + this.logger?.debug('id_token_hint verification failed', { err }); + }🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@apps/server-core/src/core/oauth2/end-session/service.ts` around lines 44 - 72, The `end-session` verification flow is swallowing all `tokenVerifier.verify` failures in the `catch` block, making forged hints and infra/network errors indistinguishable. Update the `catch` in `service.ts` around `this.tokenVerifier.verify(...)` to log the verification failure with enough context (without changing the no-revoke behavior), so `hintVerified` still stays false but operational issues are observable.packages/server-kit/src/crypto/json-web-token/verify/module.ts (1)
32-34: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low valueComment slightly overstates this function's scope.
This function only performs signature and
nbfchecks (plus optionalexp);kind/issuer validation happens in the caller (e.g.OAuth2EndSessionService). Worth tightening the comment so future readers don't assumekindis enforced here.✏️ Suggested comment tweak
- // Signature, nbf and issuer/kind checks always apply; only exp is skipped - // when explicitly requested (e.g. an id_token_hint on RP-initiated logout). + // Signature and nbf checks always apply; only exp is skipped when + // explicitly requested (e.g. an id_token_hint on RP-initiated logout). + // Note: `kind`/issuer validation is performed by the caller, not here.🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@packages/server-kit/src/crypto/json-web-token/verify/module.ts` around lines 32 - 34, The comment in the JWT verify module overstates what this function enforces, since `verifyJwt` only handles signature and `nbf` checks plus optional `exp`, while issuer/kind validation is done by the caller such as `OAuth2EndSessionService`. Update the inline comment near `validateExp` in `verify/module.ts` to reflect the actual scope and avoid implying `kind` is validated here.apps/server-core/test/unit/core/oauth2/end-session/service.spec.ts (1)
73-187: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick winAdd coverage for "no hint" and
sub_kindmismatch on revoke.Coverage is otherwise thorough, but two behaviors called out in the PR description aren't directly tested:
- Calling
verify()/the logout flow withoutid_token_hintshould not mutate session state.revoke()should reject a session match whensubmatches butsub_kinddiffers (onlysubmismatch is currently tested, at Line 173).🧪 Suggested additional test cases
it('should NOT mutate session state without an id_token_hint', async () => { const service = buildService(async () => validPayload); const result = await service.verify({ client_id: clientId }); expect(result.hintVerified).toBe(false); expect(result.sessionId).toBeUndefined(); }); it('should NOT revoke a session when sub matches but sub_kind differs', async () => { await sessionManager.create({ id: sessionId, sub, sub_kind: OAuth2SubKind.CLIENT, // different sub_kind realm_id: realmId, }); const service = buildService(async () => validPayload); const revoked = await service.revoke(sessionId, sub, OAuth2SubKind.USER); expect(revoked).toBe(false); expect(sessionManager.revokeCalls).toHaveLength(0); });🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@apps/server-core/test/unit/core/oauth2/end-session/service.spec.ts` around lines 73 - 187, Add test coverage in service.spec for the missing logout behaviors: in the `buildService`/`verify` cases, assert that calling `verify()` without `id_token_hint` leaves `hintVerified` false and does not set `sessionId` or mutate state; in the `revoke` tests, add a case where `sessionManager.create` uses the same `sub` but a different `sub_kind`, and verify `revoke(sessionId, sub, OAuth2SubKind.USER)` returns false and does not call `sessionManager.revoke`. Use the existing `verify`, `revoke`, `sessionManager.create`, and `sessionManager.revokeCalls` helpers to keep the new tests consistent with the current suite.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@docs/src/guide/development/api-oauth2.md`:
- Around line 175-180: Clarify the `id_token_hint` logout behavior in the OAuth2
guide: the current wording in the `id_token_hint` description suggests any
signature-valid token revokes the session immediately, but
`OAuth2EndSessionService` also requires the hint’s `sub` and `sub_kind` to match
the session subject. Update the `id_token_hint` row to state that revocation
happens only when the verified hint matches the session subject, and that a
subject mismatch is ignored as a no-op.
In
`@packages/client-web-kit/src/components/workflows/end-session/AEndSessionForm.vue`:
- Around line 49-62: Add error handling around store.logout() in
AEndSessionForm.vue so both signOut and the onMounted auto-logout do not leave
unhandled rejections. Wrap the logout call in a try/catch (or shared helper) and
ensure done.value is updated appropriately after failures, especially in the
serverRevoked path where the UI should still transition away from the pre-logout
state. Refer to the signOut function and the onMounted callback when applying
the fix.
---
Nitpick comments:
In `@apps/server-core/src/adapters/http/controllers/workflows/logout/module.ts`:
- Around line 44-67: The public logout endpoint handled by handle() in the
logout controller performs JWT signature verification on attacker-supplied
id_token_hint values, so add or confirm upstream rate limiting/backoff for this
route to reduce verification-cost DoS risk. Keep the OIDC RP-Initiated Logout
behavior intact, and ensure the protection is applied around the endpoint
exposed by this controller and its endSessionService.verify call path.
In `@apps/server-core/src/core/oauth2/end-session/service.ts`:
- Around line 44-72: The `end-session` verification flow is swallowing all
`tokenVerifier.verify` failures in the `catch` block, making forged hints and
infra/network errors indistinguishable. Update the `catch` in `service.ts`
around `this.tokenVerifier.verify(...)` to log the verification failure with
enough context (without changing the no-revoke behavior), so `hintVerified`
still stays false but operational issues are observable.
In `@apps/server-core/test/unit/core/oauth2/end-session/service.spec.ts`:
- Around line 73-187: Add test coverage in service.spec for the missing logout
behaviors: in the `buildService`/`verify` cases, assert that calling `verify()`
without `id_token_hint` leaves `hintVerified` false and does not set `sessionId`
or mutate state; in the `revoke` tests, add a case where `sessionManager.create`
uses the same `sub` but a different `sub_kind`, and verify `revoke(sessionId,
sub, OAuth2SubKind.USER)` returns false and does not call
`sessionManager.revoke`. Use the existing `verify`, `revoke`,
`sessionManager.create`, and `sessionManager.revokeCalls` helpers to keep the
new tests consistent with the current suite.
In `@packages/client-web-kit/src/core/oauth2/authorization-request.ts`:
- Around line 107-142: Add unit tests for buildEndSessionURL to cover the new
public helper’s behavior: verify trailing slashes are trimmed from baseURL, each
optional field in BuildEndSessionURLContext is included only when present, and
URLSearchParams encoding is applied correctly for query values. Place the tests
alongside the authorization-request helpers so the different branches in
buildEndSessionURL are exercised and future regressions are caught.
- Around line 120-142: buildEndSessionURL is hardcoding the logout route by
appending /logout to baseURL, which makes it too tightly coupled to one server
path. Update buildEndSessionURL to accept and use the end-session endpoint
URL/path directly from BuildEndSessionURLContext (or derive it from discovery
input) instead of constructing it from baseURL, while keeping the existing query
parameter assembly for idTokenHint, clientId, postLogoutRedirectUri, state, and
realmId.
In `@packages/server-kit/src/crypto/json-web-token/verify/module.ts`:
- Around line 32-34: The comment in the JWT verify module overstates what this
function enforces, since `verifyJwt` only handles signature and `nbf` checks
plus optional `exp`, while issuer/kind validation is done by the caller such as
`OAuth2EndSessionService`. Update the inline comment near `validateExp` in
`verify/module.ts` to reflect the actual scope and avoid implying `kind` is
validated here.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro
Run ID: d493fe01-6511-4968-8202-7c78145f5038
📒 Files selected for processing (29)
.agents/architecture.mdapps/server-core/src/adapters/http/controllers/entities/realm/module.tsapps/server-core/src/adapters/http/controllers/workflows/index.tsapps/server-core/src/adapters/http/controllers/workflows/logout/index.tsapps/server-core/src/adapters/http/controllers/workflows/logout/module.tsapps/server-core/src/adapters/http/controllers/workflows/logout/types.tsapps/server-core/src/app/modules/http/modules/controller.tsapps/server-core/src/core/oauth2/end-session/index.tsapps/server-core/src/core/oauth2/end-session/service.tsapps/server-core/src/core/oauth2/end-session/types.tsapps/server-core/src/core/oauth2/index.tsapps/server-core/src/core/oauth2/token/verifier/module.tsapps/server-core/src/core/oauth2/token/verifier/types.tsapps/server-core/test/unit/core/oauth2/end-session/service.spec.tsapps/server-core/test/unit/http/controllers/entities/realm-openid.spec.tsapps/server-core/ui/src/app.tsapps/server-core/ui/src/pages/logout.vuedocs/src/guide/development/api-oauth2.mdpackages/client-web-kit/src/components/workflows/end-session/AEndSessionForm.vuepackages/client-web-kit/src/components/workflows/end-session/index.tspackages/client-web-kit/src/components/workflows/index.tspackages/client-web-kit/src/core/oauth2/authorization-request.tspackages/i18n/src/catalogs/de/client.tspackages/i18n/src/catalogs/en/client.tspackages/i18n/src/catalogs/es/client.tspackages/i18n/src/catalogs/fr/client.tspackages/i18n/src/constants.tspackages/server-kit/src/crypto/json-web-token/verify/module.tspackages/specs/src/openid/type.ts
Adds GET/POST /logout (OIDC RP-Initiated Logout, advertised as end_session_endpoint) — the RP-agnostic way for a downstream app, kit or not, to end a lingering authup session on its own logout. OAuth2EndSessionService verifies the id_token_hint via the token verifier with a new ignoreExpiry option (signature, nbf and kind still enforced; only exp is skipped — a logout hint is routinely expired). A hint whose kind is not id_token is rejected (access/refresh tokens also carry session_id, so accepting them would let a leaked access token force a logout); aud is cross-checked against client_id when both are present. A verified hint carrying sid revokes the referenced session immediately, but only after its sub/sub_kind match the hint's subject. Without a hint the endpoint mutates nothing — the SSR page's sign-out is a click-gated, bearer-authenticated logout. post_logout_redirect_uri is honored only when it is absolute http(s) and matches a registered client redirect_uri pattern (open-redirect guard); state rides only with a validated redirect. A dedicated post_logout_redirect_uri client column is a deferred follow-up. Ships the SSR logout page (AEndSessionForm), the discovery entry, and the typed buildEndSessionURL. Stacked on the prompt-surface branch (plan 041 PR C).
a708faa to
05bb11a
Compare
…-ups) (#3197) * fix: rp-initiated logout & authorize hardening (plan 041 audit follow-ups) Post-merge fixes for defects and test gaps surfaced by an audit of plan 041 (#3194/#3195/#3196). Closes plan 042 items #1, #11 and most of #12. Security / correctness: - AEndSessionForm gates its on-mount local sign-out on `serverRevoked && hintSub === store.user.id` — a cross-site /logout?id_token_hint=<attacker's own token> can no longer force-log-out an unrelated victim who merely renders the page (forced-logout CSRF). The controller forwards `hintSub` (verified hints only) into the payload. - LogoutController bounces back to the RP only when the logout was actually performed (serverRevoked && validated redirect). A hint-less or forged request renders the click-gated confirm page and redirects after sign-out, instead of 302-ing back while the session survives. - Authorize.vue: a fresh login no longer re-prompts prompt=select_account (LoginForm `done` sets accountConfirmed), and the chooser waits for `user` to resolve (no empty-name flash). - /authorize hydration payload trimmed to a ClientSummary DTO (no redirect_uri patterns, grant_types, internal URLs, secret flags). - prompt=none removed from discovery prompt_values_supported + docs (its silent-auth error redirect is unimplemented). - empty `max_age=` is treated as absent instead of coercing to 0 (z.coerce.number('') === 0 would force re-authentication). - AuthorizeForm renders a "Signed in as X - Not you?" switch chip (+ i18n). - Remove the dead OAuth2AuthorizationCode.auth_time field; use specs enums for prompt/error string comparisons instead of literals. Tests: - /logout HTTP e2e matrix (revoke, redirect+state, hint-less no-op, access-token/forged hint no-revoke, unregistered redirect dropped). - server-kit ignoreExpiry (expired+valid-sig accepted; bad-sig/nbf rejected). - auth_time passthrough + auth_time!=refreshed_at pins; redirectUriVerified; confidential refresh exemption; cross-realm login_required no-identity-oracle body; clickjacking headers + trimmed-DTO; max_age empty-vs-0; kit gate spec. * fix: use a button for the "Not you?" switch affordance The account-switch affordance is an action, not navigation — render it as a <button type="button"> styled like a link instead of an <a href="#"> so it has correct button semantics and keyboard behavior (Enter/Space activation), and matches the rest of the form's actions. * fix: reliably skip the account chooser after a fresh login on /authorize The prompt=select_account chooser reappeared right after entering username/password on the hosted /authorize page. The previous fix keyed off LoginForm's `done` emit, but on login the access-token flip re-renders Authorize and unmounts LoginForm before `done` fires, so the flag that skips the chooser was never set — the chooser stayed. Key off the store's LOGGED_IN dispatcher event instead. It is emitted only by an explicit login() (the form), never by a session restored from cookies (resolve() → RESOLVED), so a lingering session still gets the chooser while a fresh login skips it — independent of component mount/unmount timing. Adds a component spec pinning all three cases (lingering shows, LOGGED_IN skips, RESOLVED does not suppress).
Stacked on #3195 (prompt surface). PR C of the plan in
.agents/plans/041-authorize-session-binding.md. Review/merge after #3195.Problem
A downstream app that logs the user out locally had no standard way to also end the authup session — the "logout doesn't reach authup" half of the reported issue. This is deliberately not solved with a kit-specific
store.logout()session delete (that stays local-only); the RP-agnostic answer is the OIDC standardend_session_endpoint.What this adds
GET/POST /logout(OIDC RP-Initiated Logout, advertised asend_session_endpointin discovery, no feature flag). Core logic isOAuth2EndSessionService. It's the mechanism any RP — kit or non-kit React/other — redirects to on its own logout.Security posture (all enforced, full unit-test matrix):
id_token_hintis verified by the token verifier with a newignoreExpiryoption — signature,nbfandkindstill apply; onlyexpis skipped (a logout hint is routinely expired). It threads down to server-kit'sverifyToken(validateExp: false).kind !== id_tokenis rejected — access/refresh tokens also carrysession_id, so accepting them would let a leaked access token force a logout.audis cross-checked againstclient_idwhen both are present.sid→ the session is revoked immediately, but only after itssub/sub_kindmatch the hint's subject (never revoke someone else's session). Without a hint the endpoint mutates nothing — the SSR page's sign-out is a click-gated, bearer-authenticatedstore.logout().post_logout_redirect_uriis honored only when it is absolute http(s) AND matches a registered clientredirect_uripattern (open-redirect guard);staterides only with a validated redirect, and an unverified hint's claims are never reflected.Also: the SSR logout page (
AEndSessionForm+apps/server-core/ui/src/pages/logout.vue), the discoveryend_session_endpoint, and the typedbuildEndSessionURL.Testing
Full
apps/server-coresuite (1136) +@authup/server-kit(10, theverifyTokenchange) +@authup/i18nparity +@authup/client-web-kitgreen. NewOAuth2EndSessionServicematrix: valid hint verified; forged hint rejected; access-token-as-hint rejected (kind check);aud/client_idmismatch rejected; registered redirect honored; unregistered +javascript:redirect dropped; sub-match revoke vs sub-mismatch no-revoke. Plus discoveryend_session_endpointassertion.Deferred follow-up
A dedicated
post_logout_redirect_uriclient column + migration + aWebClientProvisionerdefault + the client-web end-session round-trip — until then/logoutvalidates againstredirect_uripatterns.Residual (documented)
Keycloak parity: a leaked valid id_token can force-logout its own session (an annoyance, not privilege escalation) — mitigated by the sub-match requirement and the short id_token TTL.
Summary by CodeRabbit
New Features
Bug Fixes