Repository navigation
feat: accept oidc prompt params and add auth_time/sid id_token claims - #3195
Conversation
|
Warning Review limit reached
Next review available in: 19 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 (41)
📝 WalkthroughWalkthroughThis PR implements OIDC ChangesOIDC Prompt, max_age, login_hint, and Session Claims
Estimated code review effort: 4 (Complex) | ~60 minutes Sequence Diagram(s)sequenceDiagram
participant Client
participant AuthorizeController
participant OAuth2Authorization
participant SessionManager
participant OpenIDTokenIssuer
Client->>AuthorizeController: /authorize?prompt=login&max_age=...
AuthorizeController->>OAuth2Authorization: authorize(data, options)
OAuth2Authorization->>SessionManager: get session by sessionId
SessionManager-->>OAuth2Authorization: session.created_at
OAuth2Authorization->>OAuth2Authorization: compute authTime, compare to promptLoginMaxAge/max_age
OAuth2Authorization->>OpenIDTokenIssuer: issueWithIdentity(auth_time, sid)
OpenIDTokenIssuer-->>Client: id_token with auth_time/sid claims
sequenceDiagram
participant User
participant AuthorizeVue
participant AAccountPrompt
participant Store
User->>AuthorizeVue: load /authorize with prompt=select_account
AuthorizeVue->>AuthorizeVue: parse codeRequest.prompt, check accountConfirmed
AuthorizeVue->>AAccountPrompt: render with identityName
User->>AAccountPrompt: click Continue or Switch
AAccountPrompt->>AuthorizeVue: emit continue or switch
AuthorizeVue->>Store: logout (on switch)
AuthorizeVue->>AuthorizeVue: set accountConfirmed=true (on continue), proceed to consent
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 full OpenID Connect prompt/max_age/login_hint support end-to-end (server validation + server-side enforcement + hosted UI behavior), fixes discovery metadata, and corrects/adds id_token session-related claims to better align Authup’s hosted /authorize behavior with OIDC Core expectations.
Changes:
- Accept and validate OIDC authorize params (
prompt,max_age,login_hint) and enforce freshness server-side forprompt=login/max_age. - Update hosted kit UI to render
prompt=select_accountandprompt=consentbehavior, and default kitbuildAuthorizeURL()toprompt=select_account. - Fix OIDC discovery (
revocation_endpoint,prompt_values_supported) and adjustid_tokenclaims (auth_time,sid).
Reviewed changes
Copilot reviewed 39 out of 39 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| packages/specs/src/openid/type.ts | Adds prompt_values_supported metadata typing. |
| packages/specs/src/oauth2/types.ts | Adds sid and auth_time to token payload type. |
| packages/specs/src/oauth2/error/login-required.ts | Adds re-authentication login-required constructor. |
| packages/specs/src/oauth2/constants.ts | Introduces OAuth2AuthorizationPrompt + new error codes. |
| packages/i18n/src/constants.ts | Adds client translation keys for account chooser. |
| packages/i18n/src/catalogs/fr/error.ts | Adds new OAuth error translations (FR). |
| packages/i18n/src/catalogs/fr/client.ts | Adds account chooser translations (FR). |
| packages/i18n/src/catalogs/es/error.ts | Adds new OAuth error translations (ES). |
| packages/i18n/src/catalogs/es/client.ts | Adds account chooser translations (ES). |
| packages/i18n/src/catalogs/en/error.ts | Adds new OAuth error translations (EN). |
| packages/i18n/src/catalogs/en/client.ts | Adds account chooser translations (EN). |
| packages/i18n/src/catalogs/de/error.ts | Adds new OAuth error translations (DE). |
| packages/i18n/src/catalogs/de/client.ts | Adds account chooser translations (DE). |
| packages/errors/src/constants.ts | Adds new error codes for OAuth interaction/account/consent required. |
| packages/core-kit/src/domains/authorization-code/entity.ts | Extends authorize request + code entity with prompt/login_hint/max_age/auth_time. |
| packages/client-web-kit/src/core/oauth2/authorization-request.ts | Defaults prompt=select_account; adds max_age/login_hint support. |
| packages/client-web-kit/src/components/workflows/login/LoginForm.vue | Adds usernameHint prop and prefill behavior. |
| packages/client-web-kit/src/components/workflows/authorize/AuthorizeForm.vue | Forces consent UI when prompt=consent. |
| packages/client-web-kit/src/components/workflows/authorize/Authorize.vue | Adds select_account chooser flow + passes login_hint. |
| packages/client-web-kit/src/components/workflows/authorize/AAccountPrompt.vue | New account chooser component. |
| apps/server-core/test/unit/http/controllers/workflows/token/grant-authorize.spec.ts | E2E asserts sid + session-based auth_time in id_token. |
| apps/server-core/test/unit/http/controllers/entities/realm-openid.spec.ts | Tests discovery revocation_endpoint + prompt_values_supported. |
| apps/server-core/test/unit/core/oauth2/authorization/module.spec.ts | Tests prompt=login/max_age enforcement with fake session manager. |
| apps/server-core/test/unit/core/oauth2/authorization/code-request/validator.spec.ts | Tests prompt/max_age/login_hint validation behavior. |
| apps/server-core/src/core/oauth2/token/issuer/open-id/module.ts | Uses threaded auth_time when available. |
| apps/server-core/src/core/oauth2/authorization/types.ts | Wires sessionManager + promptLoginMaxAge into authorization module context. |
| apps/server-core/src/core/oauth2/authorization/module.ts | Enforces freshness + stamps auth_time and sid into id_token. |
| apps/server-core/src/core/oauth2/authorization/code-request/validator.ts | Adds validation/coercion for prompt/max_age/login_hint. |
| apps/server-core/src/app/modules/http/modules/controller.ts | Injects session manager + config prompt max age into authorize controller. |
| apps/server-core/src/app/modules/config/validator.ts | Validates oauth2PromptLoginMaxAge config. |
| apps/server-core/src/app/modules/config/types.ts | Adds oauth2PromptLoginMaxAge config type/docs. |
| apps/server-core/src/app/modules/config/read/env.ts | Reads OAUTH2_PROMPT_LOGIN_MAX_AGE env var. |
| apps/server-core/src/app/modules/config/normalize.ts | Defaults oauth2PromptLoginMaxAge to 60. |
| apps/server-core/src/app/modules/config/constants.ts | Adds env var name constant. |
| apps/server-core/src/adapters/http/controllers/workflows/authorize/types.ts | Adds prompt max age option + session manager in controller ctx types. |
| apps/server-core/src/adapters/http/controllers/workflows/authorize/module.ts | Passes prompt max age + session manager into authorization core. |
| apps/server-core/src/adapters/http/controllers/entities/realm/module.ts | Fixes discovery revocation_endpoint and advertises prompt values. |
| apps/server-core/src/adapters/http/controllers/entities/identity-provider/module.ts | Threads codeRequest params into redirect URL (needs fix for falsy values). |
| .agents/architecture.md | Documents prompt surface, enforcement, and claims behavior. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
Actionable comments posted: 1
🧹 Nitpick comments (6)
packages/client-web-kit/src/components/workflows/authorize/AAccountPrompt.vue (1)
53-56: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick winDecorative icon should be hidden from assistive tech.
The
VCIconhere is purely decorative (the heading text already conveys the "select account" context), so it should be excluded from the accessibility tree to avoid being announced redundantly by screen readers.♿ Proposed fix
<VCIcon name="fa6-solid:user" class="text-6xl text-info-600" + aria-hidden="true" />🤖 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/components/workflows/authorize/AAccountPrompt.vue` around lines 53 - 56, The VCIcon in AAccountPrompt.vue is decorative and should not be exposed to assistive technology. Update the VCIcon usage in the authorize account prompt so it is hidden from the accessibility tree, keeping the heading as the only announced context. Use the existing VCIcon component there and add the appropriate accessibility-hidden treatment so screen readers do not announce it redundantly.packages/client-web-kit/src/core/oauth2/authorization-request.ts (1)
68-77: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick winConsider a narrower type for
prompt.Now that
OAuth2AuthorizationPromptis imported, typingprompt?: stringloses the compile-time guarantee that only valid prompt values (or'') are passed.♻️ Suggested fix
- prompt?: string, + prompt?: OAuth2AuthorizationPrompt | '',🤖 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 68 - 77, The `prompt` field in `OAuth2AuthorizationRequest` is too loosely typed as `string`, which removes the compile-time validation now that `OAuth2AuthorizationPrompt` is available. Update the `prompt` property in `authorization-request.ts` to use the narrower imported prompt type (while still allowing `''` if needed), and make sure any related references to `OAuth2AuthorizationRequest` continue to compile with the stricter type.packages/client-web-kit/src/components/workflows/authorize/Authorize.vue (2)
27-33: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick winUse the shared
OAuth2AuthorizationPromptenum instead of a local string constant.
authorization-request.tsalready importsOAuth2AuthorizationPromptfrom@authup/specsand usesOAuth2AuthorizationPrompt.SELECT_ACCOUNT. This file re-declares the same value as a raw string (OAUTH2_PROMPT_SELECT_ACCOUNT = 'select_account'), andAuthorizeForm.vueuses the literal'consent'for the same purpose. If the spec enum values ever change, these hardcoded strings will silently drift out of sync.♻️ Suggested fix
-import AAccountPrompt from './AAccountPrompt.vue'; +import { OAuth2AuthorizationPrompt } from '`@authup/specs`'; +import AAccountPrompt from './AAccountPrompt.vue'; import AuthorizeForm from './AuthorizeForm.vue'; import AuthorizeRealmMismatch from './AuthorizeRealmMismatch.vue'; import AuthorizeText from './AuthorizeText.vue'; - -const OAUTH2_PROMPT_SELECT_ACCOUNT = 'select_account';Then reference
OAuth2AuthorizationPrompt.SELECT_ACCOUNTat theprompts.includes(...)call site.Also applies to: 44-44, 165-177
🤖 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/components/workflows/authorize/Authorize.vue` around lines 27 - 33, Replace the local OAuth prompt string usage with the shared OAuth2AuthorizationPrompt enum from `@authup/specs` so the values stay in sync with the spec. In Authorize.vue, remove the OAUTH2_PROMPT_SELECT_ACCOUNT constant and use OAuth2AuthorizationPrompt.SELECT_ACCOUNT at the prompts.includes call site; also update AuthorizeForm.vue to use the matching enum value instead of the hardcoded 'consent' string.
138-141: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick winDuplicate prompt-parsing logic across components.
The
props.codeRequest.prompt ? props.codeRequest.prompt.split(' ') : []pattern is duplicated verbatim inAuthorizeForm.vue(autoConsentcomputed). Consider extracting a small shared helper (e.g.parsePromptValues(prompt?: string): string[]) in a common module to avoid future divergence between the two call sites.🤖 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/components/workflows/authorize/Authorize.vue` around lines 138 - 141, The prompt parsing logic is duplicated between Authorize.vue and AuthorizeForm.vue, so extract the shared `props.codeRequest.prompt ? props.codeRequest.prompt.split(' ') : []` behavior into a common helper such as `parsePromptValues(prompt?: string): string[]`. Update the `autoConsent` computed in `AuthorizeForm.vue` and the prompt handling in `Authorize.vue` to call that helper so both components stay consistent and future changes only happen in one place.apps/server-core/test/unit/core/oauth2/authorization/module.spec.ts (1)
92-133: 🩺 Stability & Availability | 🔵 Trivial | ⚡ Quick winAdd a test for "sessionId provided but session not found".
Coverage is solid for stale/fresh sessions and the session-less path, but there's no test exercising
options.sessionIdpointing at a session that no longer exists insessionManager(e.g. revoked). That's exactly the gap flagged inmodule.ts's freshness fallback — a test here would have caught it.it('should treat a missing/revoked session as stale for prompt=login', async () => { // sessionId does not correspond to any seeded session await expect( authorization.authorize(buildData({ prompt: 'login' }), identity, { sessionId }), ).rejects.toThrow(expect.objectContaining({ code: ErrorCode.OAUTH_LOGIN_REQUIRED })); });🤖 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/authorization/module.spec.ts` around lines 92 - 133, Add a unit test in the authorization module spec to cover the case where options.sessionId is provided but sessionManager has no matching session (revoked/missing). Extend the existing freshness tests around authorization.authorize and buildData to assert that a prompt=login request with that sessionId rejects with ErrorCode.OAUTH_LOGIN_REQUIRED, using the same authorization, identity, and sessionId setup already present.apps/server-core/test/unit/core/oauth2/authorization/code-request/validator.spec.ts (1)
46-49: 🎯 Functional Correctness | 🔵 Trivial | ⚡ Quick winAdd a regression test for
max_age=''.Given the coercion pitfall flagged in
validator.ts(empty string silently becomes0), add a test asserting the expected behavior once fixed (e.g.max_age: ''→undefined/null, not0).it('should not coerce an empty max_age to 0', async () => { const output = await validator.run({ ...base, max_age: '' }); expect(output.max_age).not.toEqual(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/authorization/code-request/validator.spec.ts` around lines 46 - 49, Add a regression test in validator.spec.ts around validator.run to cover the empty-string max_age case noted in validator.ts: extend the existing max_age coercion tests with a case like max_age: '' and assert the result is not 0 (ideally undefined/null once the fix is applied). Use the existing `validator` and `base` setup so the test clearly exercises the same code path as the numeric coercion test.
🤖 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
`@apps/server-core/src/adapters/http/controllers/entities/identity-provider/module.ts`:
- Around line 339-345: In the IdentityProvider module’s IdP replay path, the
loop over codeRequestKeys currently uses a truthy check on codeRequestValue,
which drops valid falsy values like max_age=0. Update this logic to preserve all
defined values by checking only for null/undefined before calling
url.searchParams.set, and keep the change localized to the codeRequest handling
in this method.
---
Nitpick comments:
In
`@apps/server-core/test/unit/core/oauth2/authorization/code-request/validator.spec.ts`:
- Around line 46-49: Add a regression test in validator.spec.ts around
validator.run to cover the empty-string max_age case noted in validator.ts:
extend the existing max_age coercion tests with a case like max_age: '' and
assert the result is not 0 (ideally undefined/null once the fix is applied). Use
the existing `validator` and `base` setup so the test clearly exercises the same
code path as the numeric coercion test.
In `@apps/server-core/test/unit/core/oauth2/authorization/module.spec.ts`:
- Around line 92-133: Add a unit test in the authorization module spec to cover
the case where options.sessionId is provided but sessionManager has no matching
session (revoked/missing). Extend the existing freshness tests around
authorization.authorize and buildData to assert that a prompt=login request with
that sessionId rejects with ErrorCode.OAUTH_LOGIN_REQUIRED, using the same
authorization, identity, and sessionId setup already present.
In
`@packages/client-web-kit/src/components/workflows/authorize/AAccountPrompt.vue`:
- Around line 53-56: The VCIcon in AAccountPrompt.vue is decorative and should
not be exposed to assistive technology. Update the VCIcon usage in the authorize
account prompt so it is hidden from the accessibility tree, keeping the heading
as the only announced context. Use the existing VCIcon component there and add
the appropriate accessibility-hidden treatment so screen readers do not announce
it redundantly.
In `@packages/client-web-kit/src/components/workflows/authorize/Authorize.vue`:
- Around line 27-33: Replace the local OAuth prompt string usage with the shared
OAuth2AuthorizationPrompt enum from `@authup/specs` so the values stay in sync
with the spec. In Authorize.vue, remove the OAUTH2_PROMPT_SELECT_ACCOUNT
constant and use OAuth2AuthorizationPrompt.SELECT_ACCOUNT at the
prompts.includes call site; also update AuthorizeForm.vue to use the matching
enum value instead of the hardcoded 'consent' string.
- Around line 138-141: The prompt parsing logic is duplicated between
Authorize.vue and AuthorizeForm.vue, so extract the shared
`props.codeRequest.prompt ? props.codeRequest.prompt.split(' ') : []` behavior
into a common helper such as `parsePromptValues(prompt?: string): string[]`.
Update the `autoConsent` computed in `AuthorizeForm.vue` and the prompt handling
in `Authorize.vue` to call that helper so both components stay consistent and
future changes only happen in one place.
In `@packages/client-web-kit/src/core/oauth2/authorization-request.ts`:
- Around line 68-77: The `prompt` field in `OAuth2AuthorizationRequest` is too
loosely typed as `string`, which removes the compile-time validation now that
`OAuth2AuthorizationPrompt` is available. Update the `prompt` property in
`authorization-request.ts` to use the narrower imported prompt type (while still
allowing `''` if needed), and make sure any related references to
`OAuth2AuthorizationRequest` continue to compile with the stricter type.
🪄 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: ff666484-909d-47f2-ac2b-0b9763fe206b
📒 Files selected for processing (39)
.agents/architecture.mdapps/server-core/src/adapters/http/controllers/entities/identity-provider/module.tsapps/server-core/src/adapters/http/controllers/entities/realm/module.tsapps/server-core/src/adapters/http/controllers/workflows/authorize/module.tsapps/server-core/src/adapters/http/controllers/workflows/authorize/types.tsapps/server-core/src/app/modules/config/constants.tsapps/server-core/src/app/modules/config/normalize.tsapps/server-core/src/app/modules/config/read/env.tsapps/server-core/src/app/modules/config/types.tsapps/server-core/src/app/modules/config/validator.tsapps/server-core/src/app/modules/http/modules/controller.tsapps/server-core/src/core/oauth2/authorization/code-request/validator.tsapps/server-core/src/core/oauth2/authorization/module.tsapps/server-core/src/core/oauth2/authorization/types.tsapps/server-core/src/core/oauth2/token/issuer/open-id/module.tsapps/server-core/test/unit/core/oauth2/authorization/code-request/validator.spec.tsapps/server-core/test/unit/core/oauth2/authorization/module.spec.tsapps/server-core/test/unit/http/controllers/entities/realm-openid.spec.tsapps/server-core/test/unit/http/controllers/workflows/token/grant-authorize.spec.tspackages/client-web-kit/src/components/workflows/authorize/AAccountPrompt.vuepackages/client-web-kit/src/components/workflows/authorize/Authorize.vuepackages/client-web-kit/src/components/workflows/authorize/AuthorizeForm.vuepackages/client-web-kit/src/components/workflows/login/LoginForm.vuepackages/client-web-kit/src/core/oauth2/authorization-request.tspackages/core-kit/src/domains/authorization-code/entity.tspackages/errors/src/constants.tspackages/i18n/src/catalogs/de/client.tspackages/i18n/src/catalogs/de/error.tspackages/i18n/src/catalogs/en/client.tspackages/i18n/src/catalogs/en/error.tspackages/i18n/src/catalogs/es/client.tspackages/i18n/src/catalogs/es/error.tspackages/i18n/src/catalogs/fr/client.tspackages/i18n/src/catalogs/fr/error.tspackages/i18n/src/constants.tspackages/specs/src/oauth2/constants.tspackages/specs/src/oauth2/error/login-required.tspackages/specs/src/oauth2/types.tspackages/specs/src/openid/type.ts
c2fa21c to
9421447
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: |
Accept the OIDC Core §3.1.2.1 authorize params prompt / max_age / login_hint (previously silently stripped). Since /authorize is a hosted login page, the kit's Authorize.vue renders the behavior for every RP: prompt=select_account shows a "continue as / use another account" chooser instead of silently continuing, login_hint pre-fills the identifier, and prompt=consent forces the consent screen for built_in clients. buildAuthorizeURL defaults prompt=select_account so kit apps inherit account switching. prompt=login / max_age freshness is enforced server-side in OAuth2Authorization.authorize() against the backing session's created_at (never refreshed_at); the window is config oauth2PromptLoginMaxAge (default 60s). A session-less (HTTP Basic) authorize counts as freshly authenticated. id_token claims: auth_time is now the session's creation time threaded through the token payload (was wrongly the issuance time == iat), and a sid claim (= session_id) is added for RP-initiated / back-channel logout. Discovery advertises prompt_values_supported and fixes revocation_endpoint from /token to /token/revoke (RFC 7009). Stacked on the realm-binding branch (plan 041 PR B).
9421447 to
675eecf
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).
Builds on #3194 (realm binding). PR B of the plan in
.agents/plans/041-authorize-session-binding.md.Problem
authup silently stripped the OIDC
prompt/max_age/login_hintauthorize params, so a relying party had no standard way to force account selection or re-authentication. Combined with a lingering authup session,/authorizewould silently continue as the current user — the "no confirmation to continue as X or choose another account" half of the reported issue. Two pre-existing bugs also rode along: the id_tokenauth_timeclaim was the token issuance time (not the real authentication time), and discovery advertisedrevocation_endpointas/token(an RFC 7009 POST there never worked).What this does
Because authup's
/authorizeis a hosted login page, the hosted UI renders the prompt behavior for every RP — kit or non-kit React/other:prompt=select_account→ an "Continue as X / Use another account" chooser instead of silently continuing.buildAuthorizeURL(kit) defaults toselect_account, so kit apps inherit account-switching on a version bump (opt out by passingprompt='').login_hint→ pre-fills the identifier field (canonicalizedtrim().toLowerCase()).prompt=consent→ forces the consent screen even for abuilt_inclient.prompt=login/max_age→ freshness enforced server-side inOAuth2Authorization.authorize()against the backing session'screated_at(neverrefreshed_at— a token refresh must not reset the authentication instant); a session-less HTTP Basic authorize counts as freshly authenticated. The window isconfig.oauth2PromptLoginMaxAge(OAUTH2_PROMPT_LOGIN_MAX_AGE, default 60s — a documented stateless approximation). Unknownprompttokens are ignored (forward-compat);nonecombined with any other value isinvalid_request.Bug fixes included
auth_timeis now the session's creation instant (was the issuance time ==iat).sidclaim (=session_id) added to the id_token — prerequisite for RP-initiated / back-channel logout (PR C).prompt_values_supportedand fixesrevocation_endpoint→/token/revoke.Testing
Full
apps/server-coresuite (1126) +@authup/i18nparity (77) +@authup/client-web-kit(11) green. New tests: validator (unknown-prompt ignored,none+others →invalid_request,max_agecoercion,login_hintcanonicalization), deterministicprompt=login/max_ageenforcement via a fake session manager with controlledcreated_at(stale →login_required, fresh → passes, session-less → passes), the id_tokensid/auth_timee2e, and discovery assertions.Notes / deferred
prompt=nonesilent-auth UI is deferred — it's moot behind theframe-ancestors: 'none'header from feat: realm-bind the authorize and token flow #3194 (iframe silent-renew is blocked), andprompt=loginadditionally degrades via feat: realm-bind the authorize and token flow #3194'sloginRequiredbackstop.prompt/max_agenow get spec-correct behavior;auth_timereports older (correct) values for consumers that misused it asiat.revocation_endpointconsumers that cached discovery should re-fetch.sidreference the bearer session rather than a freshly-created fallback session; documented residual, to be tightened with PR C.Summary by CodeRabbit
prompt=loginandmax_agerequests.