Guides
Upgrading to Entro Auth 1.8
Upgrade Entro Auth from 1.7 to 1.8, including schema changes and breaking changes in sign-up, phone numbers, One Tap, social provider profiles, the OAuth provider, resource servers, device authorization, and SAML.
Most projects upgrade to Entro Auth 1.8 with one command:
npx @entro314labs/entro-auth-cli@latest upgradeUpgrade @entro314labs/entro-auth and every @entro314labs/entro-auth-* package together so they stay on 1.8.
Some areas change behavior or types. Use this table to choose the sections that apply to your project.
| If your project | Read |
|---|---|
| Uses Entro Auth at all | Core |
| Uses social login, generic OAuth, or One Tap | Social and generic OAuth sign-in |
| Uses the phone number plugin | Phone number |
| Runs its own OAuth or OpenID provider | Schema changes and As an identity provider |
| Verifies access tokens as a resource server | Resource servers |
| Uses the device authorization plugin | Device authorization |
| Uses SAML SSO | Enterprise SSO |
| Uses passkeys, Electron, or Drizzle | Other plugins and adapters |
Schema changes
Only the OAuth provider plugins add columns in 1.8. Every oauthProvider() setup needs them, even when the feature that uses a column is off. Every new column is optional, so no data step is needed. Other projects can skip this section.
oauthProvider()adds:acr,amr, andgrantIdonoauthRefreshTokenact,grantId, andaccessTokenClaimsonoauthAccessTokenexpiresAt,sectorIdentifier,frontchannelLogoutUri,frontchannelLogoutSessionRequired, andrequirePushedAuthorizationRequestsonoauthClientaccessTokenFormatonoauthResource
oauthDeviceAuthorization()addsreferenceId,authTime,acr, andamrondeviceCode.
Apply the schema, then deploy the 1.8 packages. With the built-in Kysely adapter, run npx @entro314labs/entro-auth-cli@latest migrate. With Drizzle, Prisma, or a custom schema workflow, run npx @entro314labs/entro-auth-cli@latest generate, review the output, and apply it with your migration tooling. MongoDB needs no migration.
With the Kysely, Prisma, or Drizzle adapter, the default schema check fails every request until the new columns exist. With Prisma or Drizzle, a regenerated client or schema deployed before the migration fails every request that reads an OAuth client, token, or device code.
Core
Node.js 24.7.0 or later
Every package, including the CLI, requires Node.js 24.7.0 or later when it runs on Node.js. Node.js 22 is no longer supported or tested. Upgrade Node.js before you upgrade Entro Auth. Bun, Deno and Cloudflare Workers are unaffected.
Sign-up side effects run after the account is saved
Entro Auth now sends the verification email for an email sign-up, or for a new social or SSO account, only after the account is saved. onExistingUserSignUp also runs after the sign-up's database work completes. A sign-up that rolls back no longer sends an email for an account that doesn't exist.
This changes how errors from these callbacks behave:
- If
sendVerificationEmailoronExistingUserSignUpthrows during a sign-up, the sign-up now succeeds and the error is logged. Before, a callback that threw synchronously failed and rolled back the sign-up. - If a
databaseHooksuseroraccountafterhook throws during a sign-up, the request still fails, and the verification email is not sent. The user can request a new one.
What to do: if you threw from sendVerificationEmail or onExistingUserSignUp to reject a sign-up, move that check out of the callback. To reject only new accounts, return false from a databaseHooks.user.create.before hook:
export const auth = entroAuth({
databaseHooks: {
user: {
create: {
before: async (user) => {
if (!isAllowedDomain(user.email)) {
return false;
}
},
},
},
},
});This hook doesn't run when the email already exists, because that sign-up never creates a user. For a check that must also reject those attempts, use a before hook on /sign-up/email.
Session cache writes after sign-in
This applies with secondaryStorage and session.storeSessionInDatabase: true. Social, SSO, One Tap, and OAuth proxy sign-ins now write the session to secondary storage after the commit, as email sign-up already did. A failed write is logged instead of failing the sign-in. With session.preserveSessionInDatabase: true, a failed write still fails the sign-in.
Sensitive routes require a live session
This applies with a server-side session store. These routes now check that the session is still active in the store, even when the cookie cache is on:
- Passkey registration
- Device-code approval
- Two-factor enrollment and backup code generation
- Phone number changes
- Social account linking
- Organization invitations
A session created from an API key with enableSessionForAPIKeys is refused on these routes.
What to do: if you call linkOAuthAccount directly, pass the session that started the link in the OAuth state. Social link callbacks now require that session.
More routes require a fresh session
A session is fresh while it signed in less than session.freshAge ago (one day by default). These requests now need one, and are refused with 403 SESSION_NOT_FRESH otherwise:
linkSocial, including a re-link that only asks an already linked provider for more scopeschangeEmail, unlesssendChangeEmailConfirmationhas the current address confirm the changeemailOtp.requestEmailChange, unlesschangeEmail.verifyCurrentEmailasks for a code from the current address- With two-factor's
allowPasswordless, for an account that has no password:enable,disable,getTotpUriandgenerateBackupCodes passkey.deletePasskey, asaddPasskeyalready did: a session that could not add a way in cannot take one away
deleteUser without a password already needed one. It now answers 403 SESSION_NOT_FRESH where it answered 400 SESSION_EXPIRED.
What to do: handle SESSION_NOT_FRESH in one place by having the user sign in again, then retry. An account with two-factor on can instead check a code (verifyTotp, verifyOtp, verifyBackupCode) from the signed-in session. If you matched SESSION_EXPIRED on deleteUser, match SESSION_NOT_FRESH.
Two-factor holds back every way of signing in
An account with two-factor on was held to the second step on a password sign-in only. An emailed code, a magic link, a social or SSO provider, One Tap, Sign-In with Ethereum or a phone code signed it in without one. They are all held back now.
What to do:
- A sign-in that answers in JSON answers
twoFactorRedirect: true, as a password sign-in does: show the second step there too. - A sign-in that ends in a redirect (a provider's callback, a magic link) lands on the same address with
twoFactorRedirect=trueandtwoFactorMethodsadded. That page has to be reachable signed out, and has to ask for the code when it sees them. With the Iris handlers,secondFactorFromRedirectreads them. - In an Expo app,
signIn.socialresolves withtwoFactorRedirect: true; update@entro314labs/entro-auth-expowith the server. - If you gate those paths yourself, with a hook that re-runs the two-factor check, remove it or set
twoFactor({ enforceOn: "credentials" }): the two would hold the same sign-in back twice. enforceOn: "credentials"keeps the earlier scope.
A two-factor code checked while signed in counts, and renews the session
verifyTotp, verifyOtp and verifyBackupCode called from a session that is already signed in now count a wrong code toward the account's lockout. A right code, for an account with two-factor on, renews the session: it gets a new token, is fresh again, and stays the same session, so what was issued in it stays valid.
The same holds for a passkey: passkey.verifySecondFactor() called from a signed-in session of an account with two-factor on, with no setup left to finish, renews the session too.
What to do: a client that stores the session token itself must take the new one from the response; the old token stops working.
A provider is not linked by signing in to an account with two-factor on
A provider's first sign-in is linked to the account whose address it gives before the second step is asked for. Until now that link stayed even when the second step was never passed. Where provider sign-ins are held to the second step (the default, enforceOn: "all"), such a sign-in to an account with two-factor on is now refused with PROVIDER_NOT_LINKED (403) and links nothing.
What to do:
- Give signed-in users a way to link a provider (
authClient.linkSocial): it is now the only way an account with two-factor on adds one. The Iris account security block has it. - Handle
error=PROVIDER_NOT_LINKEDon your sign-in error page, besideaccount_not_linked: tell the person to sign in the way they usually do, then link the provider from their account. - The same applies to One Tap and to SSO: a first SSO sign-in to an existing account with two-factor on is refused, unless your
resolveUserchooses the user. - Accounts without two-factor, providers that are already linked, and
enforceOn: "credentials"behave as before.
Turning two-factor on or off renews the session in place
Turning two-factor on (twoFactor.enable when it takes effect at once, the first code that finishes a setup, or a passkey used to finish one) and turning it off (twoFactor.disable) gave the session a new token by ending it and starting another. They now renew it: a new token, the same id and expiry. What was issued in the session, such as an access token from the OAuth provider or mcp, stays valid; before, it was cut off.
What to do:
- If you have
databaseHooks.session.createorsession.deletehooks that relied on firing at these endpoints, move that logic tosession.update, which fires now. Asession.update.beforehook that returnsfalseleaves the session on its old token; the change to two-factor stands. - The session keeps its expiry. Before, the replacement started a full new lifetime.
Expired verification rows are cleaned up on use
Expired verification rows are now also deleted when a single-use value, such as a magic link, an OTP, or an issued nonce, is used. Before, cleanup ran only when a value was looked up. A lookup that finds an expired row deletes the expired rows for that identifier. Deleting every expired row runs at most once a minute per server instance, after a lookup or a consumed single-use value. verification.disableCleanup turns off every one of these deletes.
Social and generic OAuth sign-in
Google One Tap requires a server-issued nonce
/one-tap/callback now requires a single-use nonce from the new POST /one-tap/nonce endpoint, so each Google ID token signs in only once.
If you sign in with authClient.oneTap(), the client fetches the nonce for you. Remove its nonce option and any nonce in additionalOptions, which are now ignored.
If you call /one-tap/callback or auth.api.oneTapCallback yourself, the callback now rejects requests that were accepted before:
- A request without a
noncereturns400. - A nonce that is unknown, expired, or already used returns
400 INVALID_ID_TOKEN_NONCE. - A token whose
nonceclaim differs from the nonce is rejected as an invalid ID token.
What to do: fetch a nonce from POST /one-tap/nonce, pass it to Google, and send it back in the callback body, as Nonce shows.
ID token sign-in rejects an opaque token sent with a nonce
When a client signs in or links an account with a provider token through signIn.social or linkSocial, and the request also sends a nonce, an opaque (non-JWT) token, such as a Facebook Graph access token, is now rejected. An opaque token cannot carry a nonce, so the nonce cannot be checked. Opaque tokens sent without a nonce are still accepted.
What to do: if a provider sets a custom verifyIdToken, compare the request's nonce to the token's nonce claim inside it.
Generic OAuth rejects an Authorization entry in authorizationHeaders
A generic OAuth provider whose authorizationHeaders contains Authorization, in any letter case, now fails at startup with an error that names the provider. Before, Entro Auth sent that header to the token endpoint, where it could conflict with the client authentication from clientSecret or tokenEndpointAuth.
What to do: set the header from a custom token endpoint method. The custom method adds no client credentials, so set every credential the provider requires:
tokenEndpointAuth: {
method: "custom",
customizeRequest({ body, headers }) {
body.set("client_id", process.env.PROVIDER_CLIENT_ID!);
headers.authorization = `Provider ${process.env.PROVIDER_CREDENTIAL}`;
},
},Direct calls to validateAuthorizationCode, authorizationCodeRequest, refreshAccessToken, or refreshAccessTokenRequest from @entro314labs/entro-auth-core/oauth2 that pass authorization in headers now throw.
Generic OAuth signs assertions for the issuer
This applies if a generic OAuth provider uses private_key_jwt with createPrivateKeyJwtClientAssertionGetter. Each assertion is now signed for the authorization server's issuer, which generic OAuth takes from the provider's discovery document. Before, it was signed for the token endpoint URL. This follows RFC 10070 §4.
These providers still sign for the token endpoint URL:
- A generic OAuth provider configured without
discoveryUrl, because it has no discovered issuer. - The
oktaandmicrosoftEntraIdhelpers. Okta and Microsoft Entra ID document only their token endpoint URL as the assertion audience. - OIDC SSO providers, unless you opt in; see SSO can sign client assertions for the issuer.
An assertion now carries the JOSE header typ: "client-authentication+jwt" only when its audience is the known issuer. Before, it carried typ: "JWT". Every other assertion, such as one signed for a token endpoint URL that is not the issuer or one signed without a known issuer, still carries typ: "JWT".
What to do: if a generic OAuth provider accepts only its token endpoint URL as the audience, set audience: "token_endpoint":
getClientAssertion: createPrivateKeyJwtClientAssertionGetter({
privateKeyJwk: { /* your JWK */ },
audience: "token_endpoint",
}),Generic OAuth checks the discovered issuer
Unless issuer is set, discoveryUrl must now be a well-known URL, and the discovery document's issuer must be the issuer the URL is built from. Otherwise Entro Auth logs an error that names the provider and both values, and skips the provider. Before, the document was used whatever issuer it named.
A common case is an issuer with a path, such as https://auth.example.com/api/auth, whose discovery document is read from the root, https://auth.example.com/.well-known/openid-configuration. That URL belongs to the issuer https://auth.example.com, so the provider is now skipped.
What to do: if a provider is skipped after the upgrade, check its documentation for its issuer identifier. For an issuer with a path, point discoveryUrl at the provider's documented well-known URL for that issuer: either {issuer}/.well-known/openid-configuration, or the RFC 8414 form with /.well-known/oauth-authorization-server inserted between the host and the issuer's path. If the provider publishes discovery at a path that is not a well-known URL, or under another name for the same issuer, such as a tenant domain instead of the tenant ID, set issuer to that identifier. A discovery document without issuer now skips the provider even when issuer is set, so configure authorizationUrl, tokenUrl, and userInfoUrl for that provider instead of discoveryUrl. See issuer.
New Generic OAuth and client options
These are new and need no action:
- Generic OAuth providers sign in through pushed authorization requests when the provider's discovery document sets
require_pushed_authorization_requests. ThepushedAuthorizationRequestoption defaults to"auto". Set it totrueto always push, or tofalseto never push. - Client apps can send DPoP-bound requests with
createDpopFetchfrom@entro314labs/entro-auth/oauth2/dpop-client.
Social provider profile types match the provider
This applies if you use mapProfileToUser, a custom getUserInfo, or read a provider's profile type. Each profile type now matches what the provider returns. Claims that depend on a scope or account setting are optional, and a provider that omits a value leaves the stored value unchanged when profile updates are enabled.
What to do: typecheck your project and handle optional or null values. Where a provider can omit the email, such as Naver, PayPal, Paybin, Railway, or Spotify, mapProfileToUser must supply one.
These providers also change a field's type or need a code change:
- Dropbox: custom profiles must supply the new required fields, including
home_pathfor team roots. - GitHub:
idand the account counters are numbers. - GitLab:
lockedis a required boolean. - Hugging Face: organizations are arrays, and roles are strings. Use
securityRestrictionsinstead of the deprecated SSO and MFA flags. - Kick:
user_idis a number. - Linear:
avatarUrlis required and typedstring | null. - LinkedIn:
localeis a language tag string, such asen-US, instead of an object. - Microsoft Entra ID: timestamps are numbers,
groups,acrs, andxms_ccare string arrays, andin_corpis a boolean. - Notion: a missing
imageisundefinedinstead ofnull. - Paybin and Twitch: profiles come from UserInfo instead of ID token claims. A custom ID token sign-in that uses the default profile reader must also send
accessToken. - Polar: accounts are identified by the UserInfo subject, and
mapProfileToUserreceives the UserInfo claims. - VK:
user.phoneis a string. - Zoom: login types include
11,21, and23. Exhaustive login-type checks must handle them.
Apple, Cognito, Discord, Facebook Limited Login, GitLab, Google, Gumroad, Kakao, Naver, Patreon, PayPal, Railway, Roblox, Slack, Spotify, and Twitter (X) mark more claims optional or nullable. Cognito, Roblox, and Slack type custom claims as unknown. A missing email verification claim from Discord, Google, or PayPal now means unverified.
Phone number
A phone number is set only by verifying it
The phone number plugin now sets a user's number only after the user verifies it:
- Routes that create a user reject an unverified
phoneNumberfield withPHONE_NUMBER_CANNOT_BE_SET. Examples are email sign-up and an email OTP sign-in that creates a new account. - A phone number mapped from a social profile is dropped.
- Verifying a number stored unverified on another account requires that account's session, or the cookie from a
requireVerificationsign-in. Otherwise the request returnsPHONE_NUMBER_PENDING_VERIFICATION. WithupdatePhoneNumber: true, the number moves to the signed-in user instead. - Phone sign-in with
requireVerificationnow requiressendOTP, and returnsSEND_OTP_NOT_IMPLEMENTEDwithout it.
What to do: remove phoneNumber from calls that create a user, such as signUp.email. Keep it in signIn.phoneNumber, which uses it to find the account. Set a new user's number afterwards with authClient.phoneNumber.sendOtp and authClient.phoneNumber.verify({ updatePhoneNumber: true }), as the phone number plugin shows.
Phone password reset requires a verified number
requestPasswordReset no longer sends a code to a phone number that is not verified on the account, and resetPassword returns PHONE_NUMBER_PENDING_VERIFICATION without changing the password.
What to do: users with an unverified number must verify it first, or reset their password another way.
As an identity provider
This section covers @entro314labs/entro-auth-oauth-provider. Apply the schema changes first. Every setup should read the first six sections. The rest apply only if you use the feature they name.
New access token claims are reserved
The provider now sets these access token claims itself:
reference_idholds the consent reference thatpostLogin.consentReferenceIdreturns, such as an organization. JWT access tokens include it, and introspection returns it.actnames the actor of a delegated token from token exchange.ba_subholds the user ID, and the token'sactandmay_actwith their user IDs, encrypted in JWT access tokens with a pairwisesub. See Pairwisesubin JWT access tokens.grant_idnames the grant of a JWT access token. It is reserved only when you setrevocableJwtAccessTokens: true.
A value for any of these claims set by customAccessTokenClaims, an extension claims.accessToken contributor, or a resource's customClaims is now dropped with a warning. A JWT access token issued before you upgrade that carries your own ba_sub claim is inactive at UserInfo, introspection, and token exchange, because the provider cannot decrypt it. The client gets a working token at its next refresh.
What to do: rename your own claim if you set one of these names. A custom grant that issues a delegated token passes act to issueTokens.
oauthProvider({
customAccessTokenClaims: ({ user }) => ({
// was: reference_id
tenant_id: user?.tenantId,
}),
});Revocation and introspection follow RFC 7009 and RFC 7662
/oauth2/revoke and /oauth2/introspect now find a token the way the RFCs describe. Revocation documents the full behavior. These responses changed:
/oauth2/revokereturns200for an unknown or already revoked token. Before, it returned400 invalid_request. A valid JWT access token still returns400 unsupported_token_type, unless you setrevocableJwtAccessTokens: true.- A token sent with the wrong
token_type_hintis found. Before, revoke returned400and introspection returned{ "active": false }for a valid token. - A confidential client that revokes a token issued to a different client gets
400 invalid_request. A public client gets200, and the token stays valid. - A JWT-shaped token that fails verification, such as one with
alg: noneor a forged signature, is an invalid token:200from revoke,{ "active": false }from introspection, and401 invalid_tokenfrom UserInfo. Before, all three returned500. - At
/oauth2/token, a refresh token without the configuredprefix.refreshTokengets400 invalid_grant. Before, it got400 invalid_token. - In an extension grant,
provider.validateAccessTokenreturns{ active: false }for an unknown token instead of throwing.provider.requireActiveAccessTokenstill throws.
What to do: update clients and tests that expect the old status codes.
Revoking a refresh token revokes its grant
Revoking a refresh token at /oauth2/revoke now deletes every opaque access token of its grant, including tokens issued before earlier refreshes. Before, only the access tokens issued with that exact refresh token were deleted, so an older token stayed active until it expired.
- Opaque access tokens issued before you upgrade are still deleted only with the refresh token that issued them.
- Replaying a revoked refresh token deletes the refresh tokens of its grant and the opaque access tokens linked to them. See A refresh token replay revokes one grant.
- JWT access tokens stay valid until they expire. With
revocableJwtAccessTokens: true, they are revoked too, but only where the auth server checks the token, such as introspection, UserInfo, orverifyResourceRequest, and only for tokens issued after you turned the option on. With secondary storage alone, an evicted entry makes a revoked token valid again. See JWT revocation. - A refresh of the grant that is still issuing tokens when you revoke it now fails with
invalid_grant, and the tokens it stored are deleted. This needs a refresh token issued or refreshed since you upgraded. - Each grant revocation now writes one row to the verification store, with or without
revocableJwtAccessTokens. This includes revoking a refresh token, replaying one, and reusing an authorization code. YourdatabaseHooks.verificationhooks see these rows. See Grant revocation entries.
A refresh token replay revokes one grant
Replaying a rotated or revoked refresh token now revokes only the grant the token belongs to: its refresh tokens, and the opaque access tokens issued under them. Before, it revoked every refresh token the client held for that user, so one replayed token ended the user's access on every other device and agent that used the client. A grant is everything one authorization produced, whether an authorization code, a device code, or a CIBA request started it.
- The user's other grants with the same client keep their refresh tokens and access tokens. A refresh on one of them still succeeds.
- A refresh token with no grant ID, such as one rotated or revoked before you upgraded, names no grant, so a replay of it still deletes every refresh token the client holds for that user and the opaque access tokens linked to them. An unexpired token that was not rotated or revoked yet gets its grant ID at its first refresh after the upgrade. In a grant that a device code or a CIBA request started, the opaque access tokens of tokens rotated before the upgrade stay valid until they expire.
- A rotated token presented to
/oauth2/revokefollows the same rule. - A refresh of the replayed grant that is still issuing tokens fails with
invalid_grant, and the tokens it stored are deleted. This needs a replayed token with a grant ID. A refresh of another grant that is still issuing tokens keeps its tokens. - JWT access tokens follow the rules in Revoking a refresh token revokes its grant.
What to do: nothing, unless a client relied on one device's replay ending the user's other grants with it. That no longer happens. See Refresh tokens.
Overlapping refreshes get the same response
With refreshTokenReuseInterval above 0, two matching requests to refresh the same token can now receive the same response. Before, the second request failed with 400 invalid_grant, and a client that sent two refreshes at once lost its session.
The second request can wait up to 5 seconds for the first to store its response. It receives that response only if the client, scopes, resources, and DPoP key match. A retry with different but valid scopes or resources can also wait before the provider detects the mismatch. The provider returns invalid_grant on a mismatch or if the wait expires.
- The interval is set when the token rotates. If you enable it during the upgrade, it applies to later rotations. Reusing a token that rotated with the default of
0still revokes the grant. A token rotated on 1.7 with a reuse window keeps its original deadline. mcp()sets the interval to 30 seconds, so MCP clients get this behavior.- A DPoP-bound refresh must still use the key it is bound to.
What to do: nothing, unless a client relies on the second of two overlapping refreshes failing. See Refresh tokens.
A password reset revokes the user's tokens
When emailAndPassword.revokeSessionsOnPasswordReset is on, a password reset now also revokes every access and refresh token stored for the user, including offline_access grants that no session holds. It runs for /reset-password, /email-otp/reset-password, and /phone-number/reset-password, and for a user with no live session. Before, an offline_access refresh token kept working after the reset.
- A client that refreshes after a reset gets
400 invalid_grantand must start a new authorization request. - Signing out and revoking all sessions still keep
offline_accessgrants. - With
revocableJwtAccessTokens: true, the JWT access tokens of those grants are revoked too. Otherwise they stay valid until they expire, or until the session they carry assidends, which the reset does. A JWT issued without a refresh token has no stored record, so only that session rule applies to it. - A reset on a deployment that leaves
revokeSessionsOnPasswordResetoff revokes nothing.
What to do: if agents or other long-lived clients must survive a reset, set revokeGrantsOnPasswordReset: false. See Password reset.
Back-channel logout resolves the client's host name
Before each delivery, Entro Auth now resolves the host name of a client's backchannel_logout_uri. If the lookup fails or any address is loopback, private, link-local, or otherwise not publicly routable, it skips that client, logs a warning, and still revokes the session's tokens. Before, only the host name as written was checked, so a public-looking name with an internal DNS record received the Logout Token. The DNS check runs only on runtimes where node:dns resolves names.
What to do: if a client runs on an internal network and its public-looking name resolves to a private address, add the origin of its backchannel_logout_uri to trustedOrigins so it keeps receiving Logout Tokens. An origin in trustedOrigins skips only the DNS check, and a loopback or private IP literal or a name such as localhost is still rejected. Only origins configured at initialization count, so an origin that only a request supplies, such as one a trustedOrigins callback returns for a particular Request, does not. See Back-channel logout.
Deleting a consent revokes its tokens
deleteOAuthConsent now revokes the access and refresh tokens issued under the consent it deletes, scoped to that user, that client, and the consent's reference. Before, they stayed valid after the consent was gone, and a refresh token kept renewing itself indefinitely.
- A client that refreshes under a deleted consent gets
400 invalid_grantand must start a new authorization request. - Tokens the user holds for the same client under another consent reference stay valid.
- JWT access tokens stay valid until they expire. With
revocableJwtAccessTokens: true, those of a grant that has a refresh token are revoked too. A JWT issued without a refresh token is never revoked this way, but one that carries asidalso becomes inactive when its session ends. - If the revocation fails, the call fails and the consent stays, so the user can delete it again.
What to do: if a client relies on tokens that outlive a deleted consent, have it request authorization again. See Revoke tokens with a consent.
Consent approvals add to the stored consent
Accepting the consent page now adds to the user's stored consent for the client and consent reference. Before, each acceptance replaced it, so approving fewer scopes, another resource, or other UserInfo claims dropped what the user had approved earlier.
- A scope or UserInfo claim that the consent page offered and the user left out is still removed.
- The consent page shows less often. A request for access that the user approved earlier, but that a later consent page did not offer, no longer shows it. With
prompt=none, such a request now gets a code instead ofconsent_required. getOAuthConsentandgetOAuthConsentsreturn everything the user approved and did not take back, not only the last approval.- Two first acceptances at the same moment can each store a row for the same client and consent reference. Entro Auth reads such rows as one consent, and
getOAuthConsentslists them once. The next write merges them into the oldest.getOAuthConsentandupdateOAuthConsentreturn that oldest row, whoseidcan differ from the one you sent, anddeleteOAuthConsentdeletes every row of the consent. - No schema change or migration is needed. An existing consent holds its last approval, and grows from the next one.
What to do: nothing, unless you relied on a narrower approval taking back earlier access. To narrow a consent, call updateOAuthConsent. To take a consent back, call deleteOAuthConsent. It removes the consent for that client and consent reference only, and revokes the refresh tokens and opaque access tokens issued under it. JWT access tokens stay valid until they expire, unless revocableJwtAccessTokens revokes them. See Stored consent.
Pending authorization codes follow the consent
Redeeming an authorization code at /oauth2/token now needs a stored consent that still covers the code's scopes, resources, and UserInfo claims. Before, a code stayed valid for its full lifetime, 10 minutes by default, after the user deleted or narrowed the consent it was issued under.
- A redemption after the user deleted the consent, or narrowed it below what the code authorizes, fails with
400 invalid_grant. Unless the user approves that access again, the client must start a new authorization request. - If the user deletes the consent and then approves the same access again for the same client and consent reference, the code is valid again.
- Codes redeemed while the client is configured with
skip_consentbypass this check, even if a stored consent exists. - A redemption that passed the check just before the user deleted the consent can still finish, and the tokens it issues stay valid.
What to do: clients that exchange a code right after the user approves it need no change. See Manage consents.
Approved device codes follow the consent
Redeeming an approved OAuth device code at /oauth2/token now needs a stored consent that still covers the scopes and resources the user approved. Before, an approved code stayed valid for its full lifetime, 30 minutes by default, after the user deleted or narrowed the consent it was approved under.
- A poll after the user deleted the consent, or narrowed it below what they approved, fails with
400 invalid_grant. Unless the user approves that access again, the device must start a new device authorization request. - Approving another device of the same client under the same consent reference adds to that consent and leaves the first device's code valid. The first device's poll fails only if the user declined one of its scopes on the other device's consent page. An approval under another consent reference leaves the first device's consent unchanged.
- If the user deletes the consent and then approves the same access again for the same client and consent reference, the code is valid again.
- Device codes redeemed while the client is configured with
skip_consentbypass this check, even if a stored consent exists. - A CIBA request the user approved from the link is checked the same way. One approved with
completeCibaRequeststores no consent and is not checked.
What to do: devices that poll until the user decides redeem the code right after approval and need no change. See Approve the device.
Authorization code reuse revokes tokens only for the issuing client
The provider still rejects every reuse of an authorization code. To stop someone who holds a leaked code from revoking a client's tokens, a reuse now revokes the tokens issued from the code only when it comes from the client the code was issued to:
- The request must carry that client's
client_id, with its credentials for a confidential client. - For a code issued with PKCE, the request must also carry the matching
code_verifier.
A confidential client that reuses a PKCE code with its secret but without the code_verifier no longer revokes its tokens. JWT access tokens issued from the code stay valid until they expire, with the same exception for revocableJwtAccessTokens: true.
The provider remembers a redeemed code for the longer of accessTokenExpiresIn and refreshTokenExpiresIn, 30 days by default, and each refresh-token rotation extends that record. A reuse during that time revokes the tokens, even after the code itself has expired. Codes redeemed before you upgrade have no record, so reusing one revokes nothing. With secondary storage alone, an evicted record has the same effect.
When the issuing client sends two token requests that pass these checks and their DPoP proof checks with one code at the same time, the second is a reuse and revokes the grant. The first request now also fails with invalid_grant, unless it finished issuing before the revocation started. In that case, the revocation revokes its tokens, as for any reuse. A client that retries a code exchange it thinks timed out must start a new authorization request. Two requests with the same DPoP proof can end differently, as described in Sender-constrained tokens keep their binding.
Repeated request parameters are rejected
To stop a request from carrying two values that different parts of the server read differently, OAuth endpoints now reject a standard parameter sent more than once with 400 invalid_request. The error description names the parameter.
- At
/oauth2/token,/oauth2/introspect, and/oauth2/revoke, any repeated form parameter fails, such ascode=a&code=b. At the token endpoint,resourceandaudiencemay still repeat. - A form-encoded POST to
/oauth2/authorizefollows the same rules as a GET request. A repeatedresourcekeeps every value instead of only the last one. - At
/oauth2/token,/oauth2/introspect,/oauth2/revoke, and/oauth2/par, a parameter sent without a value counts as omitted, soscope=read&scope=is the same asscope=read, andresource=is the same as noresource. /oauth2/authorizekeeps empty values on GET and POST. At this endpoint,scope=requests no scopes,scope=read&scope=fails as a repeated parameter, andresource=fails withinvalid_targetbecause an empty value is not an absolute URI. At/oauth2/par, an emptyscopecounts as omitted and the default scopes apply. IfrequireOpenIdis enabled, both endpoints reject an empty or omittedscopewithinvalid_scopebefore applying defaults.- A malformed
resourceat the token endpoint, such as a relative URI, returnsinvalid_targetinstead ofinvalid_request.
What to do: clients that send each parameter once need no change. If your client matches on the error code for a malformed resource, match invalid_target.
Authorization requests without scope use clientRegistrationDefaultScopes
If you enable requireOpenId, an authorization request that omits scope still fails with invalid_scope. Otherwise, an authorization request that omits scope now gets only the client's scopes that are also in clientRegistrationDefaultScopes. Before, it got every scope the client may request, including scopes you added only through clientRegistrationAllowedScopes. When you do not set clientRegistrationDefaultScopes, nothing changes, and requests that send scope are unaffected.
What to do: if you set clientRegistrationDefaultScopes, check that clients which send no scope still get the scopes they need. A default list without openid makes that request plain OAuth, so the client gets no ID token. See Requests that omit scope.
Client metadata updates
- Updating a client with an empty
metadataobject now clears its stored metadata. Before, the old metadata stayed. - Sending
backchannel_logout_uri: nullorfrontchannel_logout_uri: nullto/oauth2/update-clientoradminUpdateOAuthClientnow clears the URI. Before,nullwas rejected. - On a client allowed to use RP-initiated logout,
updateOAuthClientand/oauth2/update-clientnow reject a newpost_logout_redirect_urisentry withinvalid_client_metadataunless it shares a scheme, host, and port with one of the client'sredirect_uris. Loopback hosts match on any port, and private-use URIs match on scheme and authority. Before, the owner could add any origin. Entries the client already has are kept, andadminUpdateOAuthClientis not limited, except when it grants logout to a client you do not own: that grant fails withinvalid_client_metadataif one of the client's stored entries breaks the rule, where a metadata document client may also use the origin of itsclient_id. The CIMD plugin also binds a metadata document's entries to theclient_idorigin by default, so a metadata document client cannot use a web origin that only itsredirect_urishave. HTTP(S) loopback redirects and hostless reverse-domain private-use logout URIs such ascom.example.app:/logoutare exempt from the CIMD origin check. What to do: to send users to another origin after logout, add a redirect URI on that origin in the same update. For a metadata document client using the defaultoriginBoundFields, use a web logout URI on theclient_idorigin. If an administrator's grant fails, the client's own registration has to change first, because the grant cannot changeredirect_urisorpost_logout_redirect_uris: its owner updates them, or a metadata document client publishes a document that fixes them. See Registered clients.
Refused metadata document URLs answer 400
This applies if you use @entro314labs/entro-auth-cimd. A client_id URL that URL validation or isMetadataDocumentUrlAllowed refuses now answers invalid_client with status 400 and uses none of the fetch budget. Before, it could answer 429 with temporarily_unavailable once the budget was spent. isMetadataDocumentUrlAllowed now runs once for each request that needs a fetch, including requests that join a fetch already in flight. Before, those requests skipped it.
What to do: if your isMetadataDocumentUrlAllowed consults an external service, keep it cheap or cache its decisions. See Configuration.
Client secret expiry takes effect
This applies if you set clientRegistrationClientSecretExpiration, or pass client_secret_expires_at to adminCreateOAuthClient or adminUpdateOAuthClient. The expiry is now saved and enforced. Once it passes, the token, introspection, and revocation endpoints reject the secret with invalid_client. Before, the value was discarded and secrets never expired.
Clients created before you upgrade have no stored expiry, so their secrets still never expire. What to do: to give an existing client an expiry, set client_secret_expires_at with adminUpdateOAuthClient, as Restricted fields describes.
Sender-constrained tokens keep their binding
This applies if you bind tokens with DPoP or mTLS, or write a clientAuthentication strategy:
- A
client_credentialstoken is now bound to theconfirmationthat aclientAuthenticationstrategy returns, such as an mTLS certificate thumbprint. When the strategy returns a DPoP key (jkt), the token type isDPoP, and the client must send a DPoP proof to every protected resource. - A confirmation that is not a DPoP key no longer satisfies a required DPoP binding. When a client registers with
dpop_bound_access_tokens: true, or a resource setsdpopBoundAccessTokensRequired: true, such an issuance fails withinvalid_dpop_proof. - A malformed
confirmationfails the request withserver_error. A confirmation must have exactly one member,jktorx5t#S256, with a non-empty string value. - A token request whose DPoP proof is rejected no longer uses up its authorization code or device code, so the client can retry with a new proof. This includes a proof whose
jtiwas already used. - When two requests redeem the same authorization code with the same DPoP proof at once, the losing request gets
invalid_dpop_proof. Before, it gotinvalid_grant. - With
oauthTokenExchange(), a client that exchanges its own DPoP-bound access token must prove the same key, with a DPoP proof or a matchingconfirmation. A client that exchanges its own certificate-bound token must return the sameconfirmationfrom its strategy, or the exchange fails withinvalid_request. DPoP checks now run beforeallowExchange.
What to do: return a confirmation from a strategy only for the key or certificate the client proved. Clients whose strategy returns a jkt must send DPoP proofs. When a token request fails with invalid_dpop_proof, the code is still unused, so retry it with a fresh proof. The exception is a client that sent the same authorization code request twice at once: the other request received the tokens, so treat the duplicate's invalid_dpop_proof as you treat invalid_grant for a code that was already sent.
Token response fields and ID token contributors resolve after the DPoP check
This applies if you set customTokenResponseFields or an extensions[].claims.idToken contributor:
- Both now run after the provider checks the DPoP proof and binding, and after the new
beforeTokenIssuance. A request with a rejected DPoP proof no longer reaches them. - An error thrown from either now comes after the request's DPoP proof is used. Authorization code, device code, and CIBA requests have already consumed their one-time credential by this point, so a retry needs a new code or request as well as a new proof. Refresh and client credentials requests need only a new proof.
What to do: if you throw from either callback to refuse tokens, move that check to beforeTokenIssuance, which is the supported place to refuse an issuance and receives the grant's acr, amr, and DPoP confirmation.
Consent reference hook runs once
postLogin.consentReferenceId now runs once per acceptance instead of twice. Accepting at /oauth2/consent with reference_id fails with invalid_request when postLogin.consentReferenceId is not configured.
What to do: if consentReferenceId has a side effect, such as writing an audit record, check that it no longer expects two calls.
Pairwise subjects for private-use and loopback redirect URIs
Pairwise clients created after the upgrade with private-use redirect URIs, such as com.example.app:/callback, or loopback ones, such as http://localhost:8787/callback, each get their own sub. Before, unrelated clients of either kind could share one. Existing clients keep their current sub.
Client assertions must name the issuer as their audience
This applies if any client authenticates with private_key_jwt, or you write a clientAuthentication strategy. A client assertion's aud must now be the provider's issuer and nothing else, at every endpoint that authenticates a client except POST /oauth2/client/rotate-keys: token, introspection, revocation, PAR, and plugin endpoints. RFC 10070 §4 and §5 require this to stop audience injection, where a malicious server replays an assertion that a client signed for an endpoint URL.
A client that signs for the token endpoint URL, the PAR endpoint URL, or the URL of another endpoint now gets invalid_client. So does a client whose aud list names the issuer and another value. The error description names the issuer to sign for, as in client assertion aud must be the issuer https://example.com/api/auth. Before, any one of these values was accepted.
What to do: update your clients to sign their assertions for the issuer. RFC 10070 §6 asks you to update clients before or together with the server. Entro Auth's generic OAuth providers with a discovered issuer sign for it by default from 1.8, as Generic OAuth signs assertions for the issuer describes. Its OIDC SSO providers sign for it when you set clientAssertionAudience: "issuer", as SSO can sign client assertions for the issuer describes.
If you cannot update every client before you upgrade, set assertionAudience: "issuer-or-endpoint". The provider then accepts the URL of the endpoint called, the issuer, or, at /oauth2/par, the token endpoint URL, as in 1.7. This setting keeps clients open to audience injection. Remove it once your clients sign for the issuer.
oauthProvider({
// Transitional: remove once every client signs for the issuer.
assertionAudience: "issuer-or-endpoint",
});POST /oauth2/client/rotate-keys is unchanged. Its assertion must still name the rotation endpoint URL.
A clientAuthentication strategy now receives acceptedAudiences, the audiences the provider accepts under assertionAudience. Pass it to consumeClientAssertion in place of expectedAudience, as Client authentication obligations shows.
The expectedAudience strategy input and the expectedAudience parameter of consumeClientAssertion are deprecated. A strategy that checks aud against expectedAudience accepts different audiences than the built-in private_key_jwt method does.
Client jwks_uri keys are refetched once a minute
This applies if a client authenticates with private_key_jwt and registers a jwks_uri. When an assertion names a key missing from the cached key set, the provider now fetches the jwks_uri again at most once every 60 seconds for each cached key set for that URI. Before, every such assertion made a fetch, so anyone who knew a client_id could make the provider call the client's endpoint on each request.
An assertion signed with a key missing from the cached key set now fails with 401 invalid_client if another unknown-key fetch of the same jwks_uri started in the last 60 seconds, even when that fetch failed, unless a request has already cached a set that holds the key. Before, the provider could fetch again and retry, which worked only if the endpoint was reachable and already published the key.
What to do: tell the clients that rotate keys through a jwks_uri to keep it reachable, publish the new key, and wait 5 minutes, the cache lifetime, before they sign with it. A client that gets this error can also retry after 60 seconds. Clients with inline jwks are unaffected. See Rotating jwks_uri keys.
Tokens carry the discovery issuer
This applies if jwt.issuer, or your baseURL when you do not set jwt.issuer, has a trailing slash, an uppercase host, a default port such as :443, a query, or a fragment. An example is baseURL: "https://example.com/api/auth/".
Discovery already published the issuer normalized: without the trailing slash, query, fragment, and default port, and with a lowercase host. In 1.7, ID tokens, JWT access tokens, introspection responses, and back-channel logout tokens carried the URL as you configured it instead. A client that compared iss with the discovery issuer, as OpenID Connect Discovery §4.3 and RFC 9068 §4 require, rejected them. These now carry the discovery issuer. In the example, iss changes from https://example.com/api/auth/ to https://example.com/api/auth.
- Introspection reports the new
issfor every opaque access token and refresh token as soon as you upgrade, including tokens issued before. - JWT access tokens and ID tokens issued before the upgrade keep the old
issuntil they expire. - Entro Auth's own checks that run in the same process accept both values: introspection, UserInfo, token exchange and its
may_actisscheck, theid_token_hintcheck at the end-session endpoint, and the defaults of the resource client andrequireMcpAuthwhen they read this server's keys or records in-process. Amay_actissyou set from the configured value incustomAccessTokenClaimskeeps working. This acceptance has no end date. - Remote verification is exact. The resource client and
requireMcpAuthexpect the discovery issuer alone when they check a signature against keys fetched from a URL and you pass noissuer. That coversjwksUrl, and the JWT plugin'sjwks.remoteUrlwhen nothing else checks the token in-process: always for the resource client, and forrequireMcpAuthwhen no OAuth provider runs in the same process. A resource server that verifies against a remote authorization server must matchissexactly (RFC 9068 §4), so it rejects JWT access tokens issued before the upgrade that carry the configured form. - The resource client's
getProtectedResourceMetadatanow lists the discovery issuer in its defaultauthorization_serversentry.
Discovery and the authorization response iss parameter do not change.
What to do: find every verifier that pins the configured value, such as an API that checks JWT access tokens with its own code or a relying party configured with a fixed issuer. Set it to the issuer from discovery. Until the JWT access tokens issued before the upgrade expire, accept both values if the verifier takes a list. A verifier that pins only the configured value rejects every new token.
In Entro Auth, an issuer you pass to the resource client's verifyOptions or to requireMcpAuth is the only value accepted. If it repeats the configured value, remove it to use the default. The default accepts both values for in-process verification, and only the discovery issuer for remote verification. To keep accepting tokens issued before the upgrade at a remote resource server until they expire, pass both values as a list in the resource client's verifyOptions.issuer. requireMcpAuth takes a single issuer, so it rejects those tokens until they expire.
UserInfo errors follow RFC 6750
/oauth2/userinfo now reports its errors the way RFC 6750 §3.1 describes, as OpenID Connect requires:
- An access token without the
openidscope gets403 insufficient_scopewith aWWW-Authenticatechallenge namingopenid. Before, it got400 invalid_scope. - An
Authorizationheader without theBearerorDPoPscheme, such as a bare token, is treated as no credentials and gets a401challenge. Before, UserInfo read the whole header value as the token.
What to do: a client that calls UserInfo must request the openid scope when it authorizes. A client whose access token lacks openid must authorize again with that scope. Send the access token as Authorization: Bearer <token>, or DPoP <token> with a DPoP proof in the DPoP header for a DPoP-bound token. Update clients and tests that match on invalid_scope from UserInfo.
Empty name and picture are left out of UserInfo
/oauth2/userinfo now leaves out the standard name and picture claims when the user's name or image is an empty string. OpenID Connect Core §5.3.2 says a claim that is not returned should be omitted, not sent as null or an empty string. Before, a user with name: "" got "name": "". A value that holds only whitespace is returned as before. customUserInfoClaims can still set these claims to an empty string, and email and email_verified are unchanged.
What to do: a client that reads name: "" now sees the key absent. Check for a missing name or picture instead of an empty string, for example userinfo.name ?? userinfo.email.
Access token claims set to undefined are left out
This applies if customAccessTokenClaims, a resource's customClaims, an extension claims.accessToken contributor, or a grant's accessTokenClaims sets a claim to undefined. That claim is now left out, and a lower-priority claim with the same name keeps its value. Before, the undefined removed that claim from the access token.
ID token and UserInfo claims already worked this way. The change also makes both token formats agree: a grant's accessTokenClaims: { tenant: undefined } removed an extension's tenant from a JWT access token, but opaque-token introspection still returned it, because stored claims cannot hold undefined.
What to do: if you set a claim to undefined to override a lower-priority claim, set the value you want instead, such as null.
oauthProvider({
customAccessTokenClaims: ({ user }) => ({
// was: tenant: user?.tenantId, to remove an extension's tenant
tenant: user?.tenantId ?? null,
}),
});Custom JWT signers must apply header.typ
The provider now accepts a JWT as an access token only when its header has typ: at+jwt, as RFC 9068 §4 requires. Introspection, revocation, UserInfo, token exchange, and verifyResourceRequest all apply the check. Previously, the provider could accept an application-signed JWT with azp when it met the other access token checks.
The provider has signed its access tokens with typ: at+jwt since 1.7, so tokens it issued keep working. A custom jwt.sign in the JWT plugin receives that typ in its header argument. The provider rejects access tokens from a signer that omits the required header. The provider logs a warning at startup when jwt.sign is set.
What to do: if you set jwt.sign, apply header to the signed header, as in Custom Signing.
jwt({
jwt: {
sign: async (payload, header) =>
new SignJWT(payload)
// was: { alg: "EdDSA", kid, typ: "JWT" }
.setProtectedHeader({ typ: "JWT", ...header, alg: "EdDSA", kid })
.sign(privateKey),
},
});Resource allowedScopes treats an empty list as no restriction
This applies if a resource has an empty allowedScopes, whether you wrote allowedScopes: [] or an adapter that cannot store null read the value back as []. In 1.7, an empty list was an allowlist with no entries, so every token request for that resource failed with invalid_scope. In 1.8, an omitted allowedScopes, null, and [] all allow every requested scope, and [] is rejected as input:
- A stored
[]row now allows every requested scope. Existing rows are not rewritten, and no schema migration is needed. The data change below is still yours to make. - A
resourcesentry withallowedScopes: []makesoauthProvider()throw at startup. adminCreateOAuthResourceandadminUpdateOAuthResourcerejectallowedScopes: []with400. Omit the field, or passnull, to allow every requested scope.- The admin endpoints return
nullfor a resource with no restriction, including a stored[]. Before, they returned the stored value. - A new resource you create or seed without
allowedScopes, and a row re-seeded inoverwritemode without it, is stored as[]. ThemergeandinsertOnlyseed modes leave an existing row's list unchanged. This lets adapters that cannot storenull, such as Prisma on PostgreSQL, CockroachDB, or MongoDB, persist it. You no longer need to declareallowedScopeson every resource, including the onemcp()adds. Code that reads theoauthResourcetable directly must treatnulland[]alike.
What to do: before the first 1.8 process starts, find the stored resources whose allowedScopes is empty, and set disabled: true on each one that relied on denying every scope, or give it real scopes. In 1.8, adminListOAuthResources and adminGetOAuthResource return null for a stored [], so they cannot show these rows afterwards. A database query stops working too once 1.8 creates, seeds, or resets an unrestricted resource, because that row is also stored as [] and looks the same as a legacy deny-all row. List the rows first with the 1.7 adminListOAuthResources endpoint or a direct database query. Also remove the empty allowedScopes from your config. Use adminUpdateOAuthResource for a row that already exists. A disabled: true in your resources config reaches an existing row only with resourceSeedMode: "merge" or "overwrite".
disabled: true is the supported way to refuse a resource. A token request for a disabled resource fails with invalid_target, whatever scopes it asks for, and no new token is issued for it. Access tokens already issued for the resource keep verifying until they expire. A refresh token for a disabled resource fails with invalid_target, so the client cannot get a new access token.
Until every instance runs 1.8, a deployment that mixes 1.7 and 1.8 processes reads the same row differently. A stored [] denies every scope on 1.7 and allows every scope on 1.8. A resource that a 1.8 process creates, seeds, or resets without scopes is stored as [], so a 1.7 process denies it. Set disabled: true first, because both versions refuse a disabled resource.
await auth.api.adminUpdateOAuthResource({
params: { identifier: "https://api.example.com" },
body: { disabled: true },
headers,
});Extension and API authors
This applies if you build on extendOAuthProvider(), call the provider API from your own endpoints, or implement it yourself:
-
provider.requireActiveAccessTokennow refuses a DPoP-bound access token with401 invalid_tokenand aDPoPchallenge, because a token string alone cannot prove that the client holds the token's key. This breaks the 1.7 recipe that callsrequireActiveAccessTokenand thenenforceDpopBindingfrom@entro314labs/entro-auth/oauth2: the first call fails for every DPoP-bound token, so the proof check never runs. Replace both calls withprovider.verifyResourceRequest(), which checks the DPoP proof with yourdpopsettings, including nonces, and thenaudienceandscopes. When it rejects the token or request, it throws a 401 or 403 that already carries its challenge. It rethrows any other error, such as a database failure, unchanged. Bearer tokens work as before. To read a token's claims whatever its binding, such as a token-exchange subject token, useprovider.validateAccessToken.reports-plugin.ts // was: // const payload = await provider.requireActiveAccessToken(token); // await enforceDpopBinding({ payload, authorization, proofJwt, ... }); const claims = await provider.verifyResourceRequest({ audience: "https://auth.example.com/api/auth/reports", scopes: ["read:reports"], }); -
Custom
OAuthProviderApiimplementations must addverifyDpopProof(),issueDpopNonce(),challengeDpopNonce(),resolveConfirmation(),resolveSubject(),verifyResourceRequest(),issueAuthorizationCode(), andvalidateAuthorizationRequest(). -
Extension grants now receive every
audiencevalue instead of only the last one. -
An
accessTokenClaimsvalue that a grant passes toissueTokensfor an opaque access token is now stored on the token. Introspection,provider.validateAccessToken, and token exchange subject-token checks such asmay_actnow see it. Keep personal data out of these claims, because they stay in the database until the token row is deleted. -
When two extensions advertise the same list in discovery, such as
authorization_details_types_supported, discovery publishes both lists combined, in registration order and without duplicates. Before, only the first-registered extension's list appeared. Other colliding keys still resolve to the first extension registered, with a warning. -
DpopBindingErrorCodeandDpopProofErrorCodefrom@entro314labs/entro-auth-core/oauth2now includeuse_dpop_nonce. DPoP checks return it only when you pass anonceoption, but exhaustive checks over either type must handle it to typecheck:function describe(code: DpopBindingErrorCode): string { switch (code) { case "invalid_token": return "Invalid access token"; case "invalid_dpop_proof": return "Invalid DPoP proof"; case "use_dpop_nonce": return "Retry with the nonce from the DPoP-Nonce header"; } }
New in 1.8
These provider features are new or opt-in, and need no action when you upgrade:
- Pushed authorization requests at
/oauth2/par, withpushedAuthorizationRequests: { enabled: true }. - Token exchange with
oauthTokenExchange(), including DPoP-bound public clients withpublicClients: "dpop-bound". - A pairwise
subin JWT access tokens, withaccessTokenSubject: "pairwise"andpairwiseSecret. Resource servers that key onsubthen see a different value for the same user in each sector. - A per-grant access token lifetime, with
accessTokenExpiresInas a function and, to go above 1 hour,accessTokenMaxExpiresIn. A number still works as before. Code that readsaccessTokenExpiresInfrom your options now seesnumber | function. See Per-grant access token lifetime. - JWT access token revocation, with
revocableJwtAccessTokens: true. Resource servers that verify tokens locally against the JWKS don't see it, so they must introspect. - A callback for each revoked grant or access token, with
onTokenRevoked. Use it to pass revocations to other services instead of matching verification identifiers indatabaseHooks.verification. It does not report ended sessions, disabled or deleted clients, deleted resources, deleted consent, or password-reset grant revocation. See Revocations it does not report. - RP-initiated logout for registered clients, with
clientRegistrationEnableEndSession. - Opaque access tokens for a resource, with
accessTokenFormat: "opaque", or for every resource that does not set a format, withresourceDefaults. beforeTokenIssuance, to refuse tokens for any grant before they are stored. Extensions can set it too. A grant that consumes a one-time credential passesconsumeCredentialtoissueTokens, so abeforeTokenIssuancerefusal keeps the credential.verifyResourceRequest(),issueAuthorizationCode(), andvalidateAuthorizationRequest()on the provider API, for plugin endpoints served by the auth server.- An authorization policy, with
beforeAuthorization, that can force a new sign-in or refuse a request, including a pushed one, before sign-in and consent.
Resource servers
This section applies if you verify access tokens with verifyAccessTokenRequest from @entro314labs/entro-auth/oauth2 or the resource client, answer with createResourceServerChallenge from @entro314labs/entro-auth-oauth-provider, use the MCP handler, or call getProtectedResourceMetadata.
requireMcpAuth checks tokens against the provider's records
When the OAuth provider runs in the same process, requireMcpAuth now checks each access token against its records instead of verifying JWT signatures alone. It accepts opaque access tokens, and an opaque token that was revoked, whose session ended, or whose client is disabled fails on the next request. A JWT access token fails once revoked only with revocableJwtAccessTokens: true, and a JWT whose session ended or whose client is disabled fails on the next request. The handler's claims carry the sub the token carries: for a client with subject_type: "pairwise", an opaque token's pairwise subject, and a JWT's pairwise subject when you set accessTokenSubject: "pairwise".
What to do: expect a database read per request. Set jwksUrl to keep verifying JWT signatures alone, which rejects opaque access tokens. If a handler looks users up by sub, keep its clients on subject_type: "public", or map pairwise subjects yourself.
Unsupported Authorization schemes have no error code
verifyAccessTokenRequest now rejects an Authorization header with no scheme, or with a scheme other than Bearer or DPoP, such as Basic, the same way as a request with no header. The thrown 401 no longer has error: "invalid_token" or error_description in its body. createResourceServerChallenge and the MCP handler answer it as they answer a request without a token: with a Bearer and a DPoP challenge, each with only its resource_metadata link and scope, and with algs on the DPoP challenge.
What to do: code that matched body.error === "invalid_token" for this case must check for a 401 without body.error.
Challenges offer DPoP and link to resource metadata
createResourceServerChallenge, verifyResourceRequest, and the MCP handler now build their WWW-Authenticate challenges the same way:
- A request without a token gets a
Bearerand aDPoPchallenge. Before,createResourceServerChallengeand the MCP handler sent onlyBearer. - A
DPoPchallenge carries theresource_metadatalink, asBearerchallenges already did. For a resource identifier that is not a URL, such as aurn:,createResourceServerChallengethrows whenresourceMetadataMappingshas no entry for it.Bearerchallenges already did, and nowDPoPchallenges do too. verifyResourceRequesthas noresourceMetadataMappingsoption and never throws for a missing entry. Withoutaudience, or whenaudienceis not a URL, its challenges leave outresource_metadata.
What to do: if you call createResourceServerChallenge, add a resourceMetadataMappings entry for each resource identifier that is not a URL. Clients and tests that compare the whole header value must expect the DPoP challenge too.
Verifiers expect the discovery issuer
If jwt.issuer, or your baseURL, has a trailing slash, an uppercase host, or a default port, the iss of new tokens changes. A verifier that pins the old value must update. See Tokens carry the discovery issuer under the identity provider changes.
Without an issuer option, requireMcpAuth now expects the provider's issuer, which follows jwt.issuer. Before, it expected the base URL, so with a custom jwt.issuer it rejected every token unless you passed issuer. You can remove an issuer option that repeats jwt.issuer. When it checks a signature against keys fetched from a URL, which is a jwksUrl or the JWT plugin's jwks.remoteUrl with no OAuth provider in the same process, and you pass no issuer, it expects the discovery issuer alone, and a token that carries the issuer as configured is rejected.
authorization_details_types_supported is a list
In protected resource metadata, authorization_details_types_supported is now typed as string[], as RFC 9728 requires. Before, it accepted a single string, which produced metadata that was not a valid JSON array.
What to do: if you pass this field to getProtectedResourceMetadata, wrap the value in an array.
Device authorization
OAuth device codes are approved through /oauth2/authorize
This applies to oauthDeviceAuthorization(). Standalone deviceAuthorization() setups are unaffected.
Users now approve device codes on the provider's sign-in, account selection, post-login, and consent pages, the same as an authorization request. The /device, /device/approve, and /device/deny endpoints refuse OAuth device codes with invalid_request, and the error names the URL to use.
What to do: deploy these page changes together with the upgrade, because 1.7 can't approve a code through /oauth2/authorize. Change your device verification page to send the browser to /oauth2/authorize?user_code=<code>, show the user_code on your consent page, and handle the status or error the user returns with. Approve the device shows the page.
Device code decisions and polling
These apply to both device authorization plugins:
- When the same device code is approved and denied at the same time, only the first decision takes effect. The other request fails with
invalid_requestand "Device code already processed". Before, both requests succeeded and the later one replaced the first. - The
/device/approveerror type no longer listsdevice_code_already_processed, which the server never returned. TypeScript code that compares against it must checkinvalid_request. - Device clients that poll too soon after their code expires now receive
expired_tokenright away, instead ofslow_down.
Custom DeviceAuthorizationGrant implementations
If you wrote a custom DeviceAuthorizationGrant:
- Rename
assertSessionRedemptiontoassertStandaloneUse. It now also runs for/device,/device/approve, and/device/deny, and receivesuse: "redeem"oruse: "approve". - Remove
getVerificationContext,verificationOpenAPIProperties, and the interface's second type parameter./deviceno longer returns grant details. - A grant that approves codes on its own pages can use
findDeviceCodeByUserCode,assertDeviceCodePending,decideDeviceCode, andbuildVerificationUris.
Enterprise SSO
SAML uses the NameID as the email only for the email format
SAML sign-in now uses the NameID as the user's email only when its Format is urn:oasis:names:tc:SAML:1.1:nameid-format:emailAddress. Before, any NameID became the email, even when it was not an address.
A provider that sends no email attribute, and a NameID in another format or with no format, now fails with error=missing_user_info. This includes users who signed in that way before. The server log names the format the IdP sent. A SAML response without a NameID also redirects with error=missing_user_info, instead of error=saml_error.
What to do: pick one of these before you upgrade:
- Configure the IdP to send an
emailattribute, or theemailAddressNameID format. - Set
samlConfig.mapping.emailto the attribute the IdP does send. SAML lists the attributes Entro Auth reads by default. - Return the NameID from
mapProfileToUser, as Use an email-valued NameID describes.
SAML users without a name get their email as their name
Before, a SAML user without a displayName, givenName, or surname attribute got the NameID as their name, which can be an opaque ID. In mapProfileToUser, providerUser.name is now undefined in that case. If mapProfileToUser returns a name, the user gets that name instead of the email. Existing users keep their stored name, unless resolveUser links them with profile: "update", or account.accountLinking.updateUserInfoOnLink is on when their SSO account is first linked by email.
SSO can sign client assertions for the issuer
This applies if an OIDC SSO provider uses tokenEndpointAuthentication: "private_key_jwt" and signs in to a Entro Auth 1.8 authorization server. By default, its client assertions are still signed for the provider's token endpoint URL, as in 1.7. They carry the JOSE header typ: "client-authentication+jwt" only if that URL is also the provider's registered issuer, and typ: "JWT" otherwise.
A Entro Auth 1.8 authorization server accepts only its issuer as the audience by default. To sign in to one, set clientAssertionAudience: "issuer" in the provider's oidcConfig, through registerSSOProvider or updateSSOProvider. The assertions are then signed for the provider's registered issuer, as RFC 10070 §4 asks, and carry typ: "client-authentication+jwt".
Other plugins and adapters
Passkeys enforce the user verification policy on sign-in
The passkey plugin now applies authenticatorSelection.userVerification to authentication as well as registration. When it is required, a response without the user verification flag is rejected.
What to do: if you set userVerification: "required", make sure your users' authenticators support user verification, such as a PIN or biometric. Otherwise set it to "preferred".
Electron sign-in waits for two-factor verification
Electron desktop sign-in now completes only after required two-factor verification and the other sign-in after-hooks, whatever the plugin order. Authorization codes require the issuing browser session to stay valid until the code is exchanged.
What to do: in a plugin after-hook on a credential sign-in route, handle a null ctx.context.newSession while two-factor verification is pending.
Drizzle schema marks omitted required fields as non-nullable
The Drizzle generator now emits non-nullable Relations v2 columns for fields whose required flag is omitted. Regenerating an existing schema can produce a nullability migration.
What to do: backfill any NULL values in those columns before you apply the migration.
Endpoint paths follow rou3 1.0 patterns
Plugin and custom endpoint paths are matched by rou3 1.0. A path with more than one *, **, :name+ or :name* now throws when Entro Auth starts. A bare ** match is in ctx.params["0"]; ctx.params._ still carries it at runtime, but its type is now an optional, deprecated string | undefined.
What to do: capture several parts of a path with named params (/file-:name-:version.png) or regex groups (/file-([^-]+)-([^-]+).png), and read a bare ** match from ctx.params["0"].