Repository navigation
v0.4.0
Minor Changes
-
307f05d: Carry roles, permissions and custom claims in provider tokens (#47).
- New scopes
permissions(roles,permissions,org_id,org_roles,org_permissions, orpermissions_omitted) andcustom_claims(every custom claim the API resolves for the user and the application). They appear in ID tokens,/userinfo, and a user's RFC 9068 access token for a resource when the grant holds the scope. The consent page describes both. - The values come from the API's
/oidc/accounts/:idand the API signs only what it computes again, so the edge cannot add or change one. Reserved claim names are never released, and the permission claims are released whole or not at all. - When the API refuses a sign with
claims_mismatch(a role or membership changed between the account read and the sign), the edge reads the account again and signs once more, so the token request succeeds with the new values. A second mismatch answersserver_error(500) with a description. Other refusals are not retried. org_idnow names the session's active organization rather than the user's oldest membership. This changesorg_idunder theseamlessscope too.- Needs a seamless-auth-api release that returns these claims and signs them. Against an older API none are released.
- Depend on
@seamless-auth/types^0.40.0for the shared reserved claim list, the account claims schema and theclaims_mismatchrefusal code.
- New scopes
-
18b472c: The edge now follows the API's provider key rotation without a restart. It used to load the signing keys once at startup, so after the API rotated its active key every token request failed with
unknown_keyuntil the edge restarted, and/jwksand JWT access token introspection kept the startup keys. It now re-reads the keys every five minutes and at once when the API refuses a key as unknown (at most the request that meets the rotation fails), and/jwksserves the current set. Embedders can set the interval with the newsigningKeyRefreshMsoption (0turns the timer off). A rotation to a key with a different algorithm is refused with a logged error and still needs a restart.SigningKeyRingis exported for custom setups. -
18b472c:
TRUST_PROXYnow takes a hop count (2for a CDN in front of a load balancer) or a comma-separated list of proxy addresses and subnets (10.0.0.0/8, 172.16.0.5, or Express'sloopback,linklocalanduniquelocal), and is passed to Express'strust proxyas is. Behind more than one proxy the edge used to forward the last proxy's address as the client IP, so users shared the API's per-IP rate limits and lockouts.truestill means one hop andfalsenone, so existing deployments are unchanged; a value that is neither a hop count nor valid addresses now stops the service at startup. Keep the container port reachable only through the proxy.
Patch Changes
-
bfff063: Depend on
@seamless-auth/coreand@seamless-auth/express^0.26.0. On 0.x,^0.23.0stopped at 0.23, so the edge ran on 0.23 and an application installing the provider got a second, older copy of both. The edge now has the adapter fixes from 0.25: the CSRF origin check on form posts to the auth routes (seamless-auth-server#256), no replay of a completed bearer refresh rotation (#258), no client-chosen client IP under atrust proxythat trusts every address (#257), and a bundled adapter manifest with the v0.23 routes.The hosted pages build against
@seamless-auth/react0.20 and@seamless-auth/client0.9. Client 0.8.2 sent body-less requests such as the passkey step-up start without a JSON content type or the transport header, and adapters from 0.25 refuse those with 415, so step-up needs the newer client. -
216b785: The confirmation for a native client now names the account as well as the client.
GET /interaction/:uid/detailsreturnsaccount: { identifier }(the account's email, or its phone number if it has none), oraccount: nullunless the browser is signed in as the interaction's account and the API can describe it. The hosted "Continue to ?" card shows the identifier, and with no account to name it offers only Cancel. If you serve your own pages throughuiDir, showaccount.identifierbeside the client name, send{ "confirmed": true }only from a real click, and do not offer to continue whenaccountisnull. -
7858f18: A device client polling an expired device code faster than its interval now gets
expired_token, so it stops, rather thanslow_downon every poll. The poll throttle only tracks codes that have not expired. With an API that keeps expired device codes readable for a while (seamless-auth-api#542), the token endpoint answersexpired_tokenfor them; a code the API does not know still getsinvalid_grant. -
7858f18: Errors the provider cannot send back to the app now render on the hosted pages, with your branding, instead of the library's default "oops! something went wrong" page. That covers an unknown
client_id, an unregisteredredirect_uriat/authorize, and a refused/session/end(an unregisteredpost_logout_redirect_uri, or anid_token_hintthat cannot be read). The page shows the error code, the provider's description and a plain explanation, and answers with the hosted pages' CSP andno-store. A server error shows a generic description. -
7858f18: The hosted pages meet WCAG 2.2 AA with the default palette and a sound custom one (see
docs/accessibility-audit.md).- The sign-in screens' mode toggle, error text and hovered button now take this service's palette, and follow
hosted_uibranding, instead of fallback colors that fell below 4.5:1. - Text field edges are darker (
#7a828elight,#8a93a0dark) so they meet 3:1, which also darkens card borders. - Sign-out, device and error pages are titled for what they do rather than "Sign in to ".
- The device code error is tied to the code field.
- When the hosted pages render with a
hosted_uipalette whose pairs fall below AA contrast, the service logs one warning naming each pair. Nothing is refused.
- The sign-in screens' mode toggle, error text and hovered button now take this service's palette, and follow
-
18b472c: A failure while finishing a login no longer leaves a grant behind, and unexpected errors are answered as JSON.
POST /interaction/:uid/loginsaves the grant before it reads the auth context; when that read failed (the API unreachable, say), the grant stayed and bound the first-party session to the client without a finished sign-in. The edge router also had no error handler, so such failures reached Express's default handler, which answers HTML with a stack trace wheneverNODE_ENVis notproduction. They now answer500 {"error":"server_error"}(logged by name and message), and a malformed request body answers its 4xx status with{"error":"invalid_request"}. -
18b472c:
/session/endno longer signs a browser out of the hosted pages when it has no provider sign-in. The library ends an empty provider session without a confirmation page, and the edge used to clear the first-party adapter cookies on that automatic post, so any site that sent a browser to/session/endsigned it out. The first-party session and its cookies are now ended only when the provider session had an account and the user confirmed on the hosted page. -
18b472c: A first-party native client (
application_type: native) no longer gets a code without a click. Any program on the device can listen on a loopback port or claim a private-use scheme, so a signed-in user's browser could otherwise hand a code to it with no interaction (RFC 8252 section 8.6). The hosted pages now show a "Continue to " confirmation for every native client request, after sign-in and on later requests that ride the provider session, andPOST /interaction/:uid/consentanswers403 confirmation_requiredfor a native client's prompt unless the body is{ "confirmed": true }. A custom hosted UI must send that body from the user's click. Web clients and device-flow approvals are unchanged. -
7858f18: A request object that asks for
response_mode=form_postnow gets itsrequest_not_supportedrefusal by form post rather than in the query string. Request objects are still not supported. Onlyresponse_modeis read from the refused object, without verifying it, and only the valueform_postchanges anything: the error still goes only to the request's ownredirect_urionce it is checked against the client's registered URIs, and no other value from the object is used or shown. This lets the Form Post OP conformance profile passoidcc-unsigned-request-object-supported-correctly-or-rejected-as-unsupported. -
18b472c: The device poll throttle and the resume cookie check now match paths the way the provider's router does. A device client polling
/token/was never toldslow_down, because the throttle only recognised the exact path/token; it now follows the provider's own routing, so every spelling the provider accepts is throttled. The check that a resumed authorization is the one the resume cookie names now also covers/authorize/<uid>/and a differently cased/AUTHORIZE/<uid>. -
abb4834: Depend on
@seamless-auth/types^0.36.0, which adds the session exchange contract.