@eventuras/fides-auth@0.11.0
Minor Changes
-
82ec137: Route
clientCredentialsGrantthrough openid-client instead of a rawfetch.It was the one place the server module talked to a token endpoint directly, so it
missed the transport guards the rest of the package gets for free — while being the
request that carries the client secret. Three behaviour changes, all breaking:- The token endpoint must now be https. A plain-http endpoint rejects with
OAUTH_HTTP_REQUEST_FORBIDDENinstead of posting the secret in the clear. - Failures throw openid-client's typed errors rather than a generic
Error("Client credentials grant failed: <status> - <body>"). Code matching on
that message needs updating. - Requests time out, 30 seconds by default, where previously they never did.
Configurable via the newtimeoutoption (seconds).
Also adds an optional
issuertoClientCredentialsConfig, defaulting to the token
endpoint's origin. - The token endpoint must now be https. A plain-http endpoint rejects with
-
fa9de74: RP-initiated logout: send
id_token_hint.Tokens.idTokennow holds the raw ID token — populated bybuildSessionFromTokens,
kept fresh byrefreshSession, and stored in its ownsession_itcookie so no cookie
has to carry two large JWTs.readIdTokenreads it independently of session validity,
since logout needs the hint after the access token has expired.buildOidcLogoutUrl(oauthConfig, options)acceptsidTokenHint,state,
logoutHintandincludeClientIdalongsidepostLogoutRedirectUri. A string second
argument still meanspostLogoutRedirectUri, and it still returnsnullwhen the
provider advertises noend_session_endpoint.New
handleOidcLogouthandler in@eventuras/fides-auth/server—POST-only by
default and same-origin checked viaSec-Fetch-Site/Origin— wrapped for Next.js at
@eventuras/fides-auth-next/oidc-logout. See
packages/fides-auth/docs/rp-initiated-logout.mdfor the full parameter set, where
the ID token is stored, and whyclient_idis still sent.Also fixes the
./oidc-callbackand./oidc-loginsubpath exports in
@eventuras/fides-auth-next, which pointed at files the build never emitted.persistSessionnow size-checks every cookie value before writing any of them.
Previously a value that exceeded the browser limit threw part-way through, leaving the
new session cookie next to the previous user's tokens. -
2468ac6: Set
secureon the default cookie options unconditionally.Breaking for anyone serving over plain http on a non-localhost host. Minor rather
than major because this package is pre-1.0, where minor is the breaking channel — a
major would cut 1.0.0.defaultSessionCookieOptionsanddefaultOAuthCookieOptionsderived the flag from
process.env.NODE_ENV === 'production', so any deployment that did not set
NODE_ENV— staging, a container, any server that isn't following the Next
convention — served the session cookie withoutSecure, over plain HTTP, silently.The cookie spec exempts localhost from the https requirement, so
Securecookies are
still set and sent overhttp://localhostand local development is unaffected. Plain
http on a LAN address or a custom dev hostname now needs an explicitsecure: false,
which is a deliberate choice rather than a silent default.
Patch Changes
-
db99ad0: Widen the
josedependency from an exact pin to^6.2.8.An exact pin in a library forces a second copy of
joseinto any consumer tree that
already resolves it through a range —openid-clientdepends onjose: ^6.2.2, so
this repo was carrying two copies itself — and it withholds patch releases from
consumers until we cut a release of our own. Reproducibility is the lockfile's job,
not a library's dependency range.