@openid4vc/oauth2 0.3.0-alpha-20250321213505 → 0.3.0-alpha-20250322133827
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.mts +2 -4
- package/dist/index.d.ts +2 -4
- package/dist/index.js +8 -8
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +8 -8
- package/dist/index.mjs.map +1 -1
- package/package.json +2 -2
package/dist/index.mjs
CHANGED
|
@@ -672,14 +672,8 @@ function getAuthorizationServerMetadataFromList(authorizationServersMetadata, is
|
|
|
672
672
|
// src/metadata/fetch-jwks-uri.ts
|
|
673
673
|
import { ContentType as ContentType2, createZodFetcher as createZodFetcher2 } from "@openid4vc/utils";
|
|
674
674
|
import { InvalidFetchResponseError as InvalidFetchResponseError2 } from "@openid4vc/utils";
|
|
675
|
-
async function fetchJwks(
|
|
675
|
+
async function fetchJwks(jwksUrl, fetch) {
|
|
676
676
|
const fetcher = createZodFetcher2(fetch);
|
|
677
|
-
const jwksUrl = authorizationServer.jwks_uri;
|
|
678
|
-
if (!jwksUrl) {
|
|
679
|
-
throw new Oauth2Error(
|
|
680
|
-
`Authorization server '${authorizationServer.issuer}' does not have a 'jwks_uri' parameter to fetch JWKs.`
|
|
681
|
-
);
|
|
682
|
-
}
|
|
683
677
|
const { result, response } = await fetcher(zJwkSet, ContentType2.JwkSet, jwksUrl);
|
|
684
678
|
if (!response.ok) {
|
|
685
679
|
throw new InvalidFetchResponseError2(
|
|
@@ -786,7 +780,13 @@ async function verifyJwtProfileAccessToken(options) {
|
|
|
786
780
|
`Access token jwt contains unrecognized authorization server 'iss' value of '${decodedJwt.payload.iss}'`
|
|
787
781
|
);
|
|
788
782
|
}
|
|
789
|
-
const
|
|
783
|
+
const jwksUrl = authorizationServer.jwks_uri;
|
|
784
|
+
if (!jwksUrl) {
|
|
785
|
+
throw new Oauth2Error(
|
|
786
|
+
`Authorization server '${authorizationServer.issuer}' does not have a 'jwks_uri' parameter to fetch JWKs.`
|
|
787
|
+
);
|
|
788
|
+
}
|
|
789
|
+
const jwks = await fetchJwks(jwksUrl, options.callbacks.fetch);
|
|
790
790
|
const publicJwk = extractJwkFromJwksForJwt({
|
|
791
791
|
kid: decodedJwt.header.kid,
|
|
792
792
|
jwks,
|