npm / @openid4vc/oauth2
@openid4vc/oauth2
What changed in @openid4vc/oauth2 0.3 to 0.10, from its official release notes, upgrade guides and advisories. Sources checked 2026-11-25.
41 breaking15 security3 deprecations43 new APIs and options7 behavior and defaults19 fixes and other
See which of these apply to your code, ranked, in your agent:
npx @unstale/cli init@openid4vc/oauth2 0.1022 changes
Breaking changes 14
Specification values that cannot be empty are now rejected when empty, including client_id, nonce, c_nonce, pre-authorized_code, vct, access_token and jti; dpop_signing_alg_values_supported rejects none.
@openid4vc/utils removes copies of identity-common helpers; use stringToBytes, bytesToString, base64/base64url helpers and the corresponding same-named identity-common exports.
Requests read responses within CallbackContext fetchLimits, 10 MiB per response by default. Fetch callbacks receive a request type, and fetch-taking functions accept fetchLimits.
fetchWellKnownMetadata now requires a type option: authorizationServerMetadata or credentialIssuerMetadata.
Media types are compared with isMediaType and JOSE typ values with isJwtTyp from @owf/identity-common. ContentType and the old content-type helpers are removed; use CommonMediaTypes and Oauth2MediaTypes.
Oauth2Error, Openid4vciError and Openid4vcBaseError extend IdentityError; their name is their class name, and Oauth2Error and Openid4vciError no longer append the cause message.
Oauth2JwtParseError and Oauth2JwtVerificationError are removed. Catch the exported @owf/jose errors; catch IdentityError to handle both those errors and IdentityError-derived errors.
JWT, JWK, JWA and JWS helpers are no longer exported from @openid4vc/oauth2; import the listed replacements from @owf/jose, including renamed signer and algorithm-conversion APIs.
CallbackContext replaces signJwt and verifyJwt with signJws and verifyJws; these sign or verify the signing input and return the public key used.
The @openid4vc packages use ValidationError from @owf/identity-common, with issues instead of zodError; formatZodError is removed.
Attestations signed with a jwk signer are rejected. Use x5c, a federation trust_chain, a DID, or another kid resolved and trusted by verifyJws.
DPoP proofs are time-limited by default; maxProofAgeSeconds allows skew, future iat values are rejected, and jti uniqueness is checked after signature verification.
verifyJwt now takes jwt, verifyJwsCallback and skewSeconds; checkExpirationTime, checkNotBefore and checkIssuedAt replace skipTimeBasedValidation.
JWT verification is stricter: it rejects future-issued or expired-at-expiry tokens, missing expected audiences, disallowed algorithms, ambiguous signer headers, unknown JWKS kids, malformed base64url, private JWKs and unsupported crit values.
Security 5
Authorization request verification APIs accept registered allowedRedirectUris and require an exact match; redirect_uri may be omitted only when a single URI is registered.
Client attestation verification and relevant authorization and access-token request options accept expectedChallenge, allowing servers to enforce an issued challenge.
DPoP verification APIs accept expectedNonce so servers can require a nonce for authorization and resource requests; proofs older than 300 seconds are rejected unless maxProofAgeSeconds allows more.
Authorization code access-token verification accepts expectedRedirectUri and requires the request redirect_uri to identically match the URI used when the code was issued.
A jwt credential proof with an iat more than 300 seconds ago is rejected.
New APIs and options 1
JWT verification takes now and allowedSkewInSeconds, defaulting to 30 seconds; resource servers and OAuth/OpenID clients, issuers and verifiers also take a default allowedSkewInSeconds.
Fixes and other changes 2
Client ID and secret are form-url-encoded, then base64-encoded with padding rather than base64url-encoded, to comply with the specified Basic authentication format.
JWT typ values are accepted in any casing and with the application/ prefix; compare them with isJwtTyp from @owf/identity-common.
@openid4vc/oauth2 0.97 changes
Breaking changes 1
Now requires request or request_uri, preventing unsigned requests from bypassing validation, including the https check on response_uri.
Security 1
Rejects opaque access tokens when introspection reports active: false, preventing revoked, expired, or unknown tokens from passing verification.
New APIs and options 4
Added an error code for unknown notification ids.
Added as the error code thrown when a Notification Request is invalid.
Added a method to validate a Notification Request at the issuer's notification endpoint.
Exported so consumers can name the return type of access token retrieval methods.
Behavior and default changes 1
Sends expected content types in the Accept header unless the request already sets one; the first content type is preferred and later ones receive decreasing q values.
@openid4vc/oauth2 0.811 changes
Breaking changes 2
Parsed header types now expose typ as string and preserve the value as sent.
The function now requires the hash callback.
Security 4
Fixes the cnf claim of a DPoP-bound access token on Hermes, where it could be a thumbprint string instead of an object containing jkt.
Always returns a valid header value by replacing control and non-ASCII characters with spaces and truncating error_description values longer than 500 characters, preventing header injection or errors when setting the header.
Authorization requests, token requests, and client-attestation verification accept this option to reject a client attestation for another client id.
Authorization requests, token requests, and client-attestation verification accept this option to reject a client attestation for another key; pass the thumbprint from an earlier request in later requests.
New APIs and options 3
Adds a helper for checking JWT typ values against the accepted forms.
Adds a schema that uses the JWT typ check.
verifyClientAttestationJwt now returns the thumbprint of the client attestation's cnf key, which can be passed in later requests to bind authorization sessions and refresh tokens to the client instance key.
Fixes and other changes 2
JWT typ headers accept the full media type form and any casing across the listed JWT uses; created JWTs still use the short lowercase form.
Now unescapes every escaped character in a quoted string, rather than only an escaped quote.
@openid4vc/oauth2 0.77 changes
Breaking changes 1
Renames the DPoP option allowedClockSkewSeconds to allowedSkewInSeconds across the listed verification methods.
New APIs and options 2
Adds an optional clientAttestation verification option, defaulting to 0, for nbf and exp checks on both Client Attestation JWTs and PoP JWTs.
Adds a server-level default allowed clock skew for DPoP and client attestation verification; per-call options override it, including 0.
Fixes and other changes 4
Normalizes the proof htu claim like the request URL before comparison, ignoring query and fragment and avoiding mismatches from uppercase hosts or explicit default ports.
The verify*AccessTokenRequest methods now pass now to DPoP proof verification, so iat checks use the provided time rather than the current time.
The method now honors its allowedSkewInSeconds option, which was previously ignored.
Accepts the URL scheme case-insensitively.
@openid4vc/oauth2 0.67 changes
Breaking changes 5
A missing code_verifier in an access token request for an authorization code bound to a PKCE challenge now produces
invalid_grantinstead ofinvalid_request.An access token request containing code_verifier but lacking pkce options in the verify function now fails with
invalid_grant, preventing a PKCE downgrade attack.allowRequestUri now defaults to false in parseJarRequest and validateJarRequestParams; request-by-reference JAR requests are rejected unless the option is explicitly set to true.
Pushed and interactive authorization requests containing request_uri are rejected with
invalid_requestinstead of fetching the URI.Schema validation failures for client attestation and client attestation PoP JWTs now report
invalid_clientwith status401, including for theattest_jwt_client_auth_dpopmethod.
Fixes and other changes 2
Undefined error, error_description, and scope payload entries are omitted from the WWW-Authenticate header; null values remain encoded as bare parameter names.
Authorization header authentication schemes are matched case-insensitively and resolved to their canonical form during verification.
@openid4vc/oauth2 0.538 changes
Breaking changes 6
The package's main field now points to the ESM build.
The package remains ESM-only; require('@openid4vc/oauth2') loads the ESM build and requires Node.js 20.19 or later, or 22.12 or later.
The Client Attestation PoP JWT no longer includes the exp claim.
Removes the exp field from the wallet attestation JWT payload schema.
Grant types are parsed and verified against grant_types_supported, so authorization servers must configure it correctly.
Node 18 support is dropped; Node.js 20.19+ is now the lowest supported version.
Security 3
An optional callback can provide replay protection by asserting JTI uniqueness.
Adds authorization-server verification of the combined method, requiring the attestation JWT and DPoP proof to have a matching
cnfJWK; rejects it if the server does not advertise the method.Added expectedAudience so a resource server can verify a PoP JWT bound to its own identifier.
Deprecations 3
The expectedNonce option is a deprecated alias for expectedChallenge.
The nonce option is a deprecated alias for challenge.
Deprecated in favor of allowedSkewInSeconds for better naming consistency.
New APIs and options 21
DPoP verification can optionally account for configured clock skew.
DPoP verification options are available through access-token, authorization-request, and resource-request verification APIs.
DPoP verification can optionally reject proofs older than the configured maximum age.
Type declarations are exposed through the package's types export condition.
@openid4vc/oauth2 now exports the VerifyClientAttestationOptions type.
Add an optional callback to resolve authorization server metadata without a request; returning null indicates the metadata definitively does not exist.
Add an optional callback to resolve JWK Sets without a request; returned values are validated with the JWK Set schema.
The second parameter also accepts an object with fetch and the matching resolve callback, in addition to the previously accepted Fetch implementation.
Adds a client-auth callback that emits a single DPoP proof doubling as the Client Attestation PoP, with the client instance key equal to the DPoP key.
Credential requests support di_vp proofs.
Fetches a Client Attestation challenge from the authorization server's challenge_endpoint.
Supports reactive challenge retry so the challenge is automatically included in the Client Attestation PoP when the server requests one.
Added the attest_jwt_client_auth_dpop authentication method.
Added the challenge_endpoint authorization server metadata parameter.
Added an authorization server metadata parameter for supported Client Attestation PoP signing algorithms.
Added an authorization server metadata parameter for supported client attestation signing algorithms.
Added the OAuth-Client-Attestation-Challenge header.
Exports the CreateCredentialResponseOptions type.
Adds experimental support for the OpenID4VCI 1.1 draft endpoint, allowing presentation during issuance; it may change incompatibly in a patch release.
Adds support for request and response encryption.
Accepts allowedSkewInSeconds for clock-skew handling.
Behavior and default changes 2
The Client Attestation PoP JWT uses the challenge claim instead of nonce, and verification accepts either claim.
Client Attestation and Client Attestation PoP JWTs no longer emit the iss claim; verification still accepts legacy JWTs that include it.
Fixes and other changes 3
Errors thrown by @openid4vc/oauth2 can now pass instanceof checks against the ValidationError class exported by @openid4vc/utils.
Adds support for Node 26.
Makes an exception for this JWT typ when the iss value does not match the DID in the JWT proof header.
@openid4vc/oauth2 0.47 changes
Breaking changes 2
Metadata retrieval now throws an error if an error was thrown during the first try.
Support for CommonJS/CJS syntax was removed; the package is now fully an ESM module.
Security 1
Adds a wallet method to parse and verify an authorization response redirect URL against authorization server metadata.
New APIs and options 2
The package now supports retrieving a client credentials access token.
Set this authorization server metadata value to true to meet HAIP requirements for RFC 9207 issuer identification.
Fixes and other changes 2
JWT claims iat, nbf, and exp now allow decimal numbers.
Zod errors include more detail for nested errors.
@openid4vc/oauth2 0.329 changes
Breaking changes 10
The JWE encryptor now base64-encodes apu values to align with JOSE.
The JWE encryptor now base64-encodes apv values to align with JOSE.
Corrects the parameter name from authorizationServerMetata to authorizationServerMetadata.
Replaces the dpopJwk return value with a dpop object containing jwk, and adds jwkThumbprint.
Renames the JWT signer method trustChain to federation and makes the trustChain variable optional.
Changes the JWK key_ops field to an array of strings instead of a string.
Adds kid to the JwtSigner interface.
Adds support for OpenID4VCI draft 15, with improved support for client attestations and server-side verification. Callers must handle differences between draft versions.
Renames SHA-256 to sha-256 to align with IANA hash algorithm names.
Data validation transitions from Valibot to Zod, breaking packages that re-exported Valibot types or schemas; error messages and some error structures also change.
Security 1
Pass authorizationRequestJwt to this method to ensure the JWT is verified.
New APIs and options 10
Adds a function to parse authorization response redirect URLs.
Adds support for deferred credential issuance.
Adds grant_types_supported to authorization server metadata.
Adds support for parsing and verifying an ID Token JWT according to the OpenID Connect specification.
Adds support for JAR in pushed authorization requests.
May now return authorizationRequestJwt; pass it to verifyPushedAuthorizationResponse to ensure the JWT is verified.
Adds a function to parse a pushed authorization request URI.
Adds authorization server support for refresh tokens and verifying requests with refresh token grants.
Adds support for the sha-384 hash algorithm.
Adds support for the sha-512 hash algorithm.
Behavior and default changes 4
Draft 11 remains supported using Draft 14 syntax and is automatically converted.
Allows application/json as a content type for JWK Set.
Adds support for Node.js 22 and 24.
Sends redirect_uri along in the authorization challenge endpoint so the server can use it when defaulting to a PAR request.
Fixes and other changes 4
Adds support for parsing and verifying JWTs with an array aud value.
Adds support for Draft 16 of the OpenID for Verifiable Credential Issuance.
Retrieves OAuth authorization server metadata from the correct well-known path first, then falls back to the invalid path.
Passes state to the authentication challenge request and onto the authorization request URL.