@openid4vc/oauth2 0.3.0-alpha-20250328114752 → 0.3.0-alpha-20250329201438

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 CHANGED
@@ -160,7 +160,7 @@ declare const zAuthorizationServerMetadata: z__default.ZodEffects<z__default.Zod
160
160
  introspection_endpoint_auth_methods_supported: z__default.ZodOptional<z__default.ZodArray<z__default.ZodUnion<[z__default.ZodEnum<["client_secret_basic", "client_secret_post", "attest_jwt_client_auth", "client_secret_jwt", "private_key_jwt"]>, z__default.ZodString]>, "many">>;
161
161
  introspection_endpoint_auth_signing_alg_values_supported: z__default.ZodOptional<z__default.ZodArray<z__default.ZodEffects<z__default.ZodString, string, string>, "many">>;
162
162
  authorization_challenge_endpoint: z__default.ZodOptional<z__default.ZodEffects<z__default.ZodString, string, string>>;
163
- pre_authorized_grant_anonymous_access_supported: z__default.ZodOptional<z__default.ZodBoolean>;
163
+ 'pre-authorized_grant_anonymous_access_supported': z__default.ZodOptional<z__default.ZodBoolean>;
164
164
  client_attestation_pop_nonce_required: z__default.ZodOptional<z__default.ZodBoolean>;
165
165
  }, "passthrough", z__default.ZodTypeAny, z__default.objectOutputType<{
166
166
  issuer: z__default.ZodEffects<z__default.ZodString, string, string>;
@@ -176,7 +176,7 @@ declare const zAuthorizationServerMetadata: z__default.ZodEffects<z__default.Zod
176
176
  introspection_endpoint_auth_methods_supported: z__default.ZodOptional<z__default.ZodArray<z__default.ZodUnion<[z__default.ZodEnum<["client_secret_basic", "client_secret_post", "attest_jwt_client_auth", "client_secret_jwt", "private_key_jwt"]>, z__default.ZodString]>, "many">>;
177
177
  introspection_endpoint_auth_signing_alg_values_supported: z__default.ZodOptional<z__default.ZodArray<z__default.ZodEffects<z__default.ZodString, string, string>, "many">>;
178
178
  authorization_challenge_endpoint: z__default.ZodOptional<z__default.ZodEffects<z__default.ZodString, string, string>>;
179
- pre_authorized_grant_anonymous_access_supported: z__default.ZodOptional<z__default.ZodBoolean>;
179
+ 'pre-authorized_grant_anonymous_access_supported': z__default.ZodOptional<z__default.ZodBoolean>;
180
180
  client_attestation_pop_nonce_required: z__default.ZodOptional<z__default.ZodBoolean>;
181
181
  }, z__default.ZodTypeAny, "passthrough">, z__default.objectInputType<{
182
182
  issuer: z__default.ZodEffects<z__default.ZodString, string, string>;
@@ -192,7 +192,7 @@ declare const zAuthorizationServerMetadata: z__default.ZodEffects<z__default.Zod
192
192
  introspection_endpoint_auth_methods_supported: z__default.ZodOptional<z__default.ZodArray<z__default.ZodUnion<[z__default.ZodEnum<["client_secret_basic", "client_secret_post", "attest_jwt_client_auth", "client_secret_jwt", "private_key_jwt"]>, z__default.ZodString]>, "many">>;
193
193
  introspection_endpoint_auth_signing_alg_values_supported: z__default.ZodOptional<z__default.ZodArray<z__default.ZodEffects<z__default.ZodString, string, string>, "many">>;
194
194
  authorization_challenge_endpoint: z__default.ZodOptional<z__default.ZodEffects<z__default.ZodString, string, string>>;
195
- pre_authorized_grant_anonymous_access_supported: z__default.ZodOptional<z__default.ZodBoolean>;
195
+ 'pre-authorized_grant_anonymous_access_supported': z__default.ZodOptional<z__default.ZodBoolean>;
196
196
  client_attestation_pop_nonce_required: z__default.ZodOptional<z__default.ZodBoolean>;
197
197
  }, z__default.ZodTypeAny, "passthrough">>, z__default.objectOutputType<{
198
198
  issuer: z__default.ZodEffects<z__default.ZodString, string, string>;
@@ -208,7 +208,7 @@ declare const zAuthorizationServerMetadata: z__default.ZodEffects<z__default.Zod
208
208
  introspection_endpoint_auth_methods_supported: z__default.ZodOptional<z__default.ZodArray<z__default.ZodUnion<[z__default.ZodEnum<["client_secret_basic", "client_secret_post", "attest_jwt_client_auth", "client_secret_jwt", "private_key_jwt"]>, z__default.ZodString]>, "many">>;
209
209
  introspection_endpoint_auth_signing_alg_values_supported: z__default.ZodOptional<z__default.ZodArray<z__default.ZodEffects<z__default.ZodString, string, string>, "many">>;
210
210
  authorization_challenge_endpoint: z__default.ZodOptional<z__default.ZodEffects<z__default.ZodString, string, string>>;
211
- pre_authorized_grant_anonymous_access_supported: z__default.ZodOptional<z__default.ZodBoolean>;
211
+ 'pre-authorized_grant_anonymous_access_supported': z__default.ZodOptional<z__default.ZodBoolean>;
212
212
  client_attestation_pop_nonce_required: z__default.ZodOptional<z__default.ZodBoolean>;
213
213
  }, z__default.ZodTypeAny, "passthrough">, z__default.objectInputType<{
214
214
  issuer: z__default.ZodEffects<z__default.ZodString, string, string>;
@@ -224,7 +224,7 @@ declare const zAuthorizationServerMetadata: z__default.ZodEffects<z__default.Zod
224
224
  introspection_endpoint_auth_methods_supported: z__default.ZodOptional<z__default.ZodArray<z__default.ZodUnion<[z__default.ZodEnum<["client_secret_basic", "client_secret_post", "attest_jwt_client_auth", "client_secret_jwt", "private_key_jwt"]>, z__default.ZodString]>, "many">>;
225
225
  introspection_endpoint_auth_signing_alg_values_supported: z__default.ZodOptional<z__default.ZodArray<z__default.ZodEffects<z__default.ZodString, string, string>, "many">>;
226
226
  authorization_challenge_endpoint: z__default.ZodOptional<z__default.ZodEffects<z__default.ZodString, string, string>>;
227
- pre_authorized_grant_anonymous_access_supported: z__default.ZodOptional<z__default.ZodBoolean>;
227
+ 'pre-authorized_grant_anonymous_access_supported': z__default.ZodOptional<z__default.ZodBoolean>;
228
228
  client_attestation_pop_nonce_required: z__default.ZodOptional<z__default.ZodBoolean>;
229
229
  }, z__default.ZodTypeAny, "passthrough">>;
230
230
  type AuthorizationServerMetadata = z__default.infer<typeof zAuthorizationServerMetadata>;
@@ -244,7 +244,7 @@ interface ClientAuthenticationDynamicOptions {
244
244
  * Only `client_secret_post`, `client_secret_basic`, and `none` supported.
245
245
  *
246
246
  * It also supports anonymous access to the token endpoint for pre-authorized code flow
247
- * if the authorization server has enabled `pre_authorized_grant_anonymous_access_supported`
247
+ * if the authorization server has enabled `pre-authorized_grant_anonymous_access_supported`
248
248
  */
249
249
  declare function clientAuthenticationDynamic(options: ClientAuthenticationDynamicOptions): ClientAuthenticationCallback;
250
250
  /**
@@ -7584,7 +7584,7 @@ declare function getAuthorizationServerMetadataFromList(authorizationServersMeta
7584
7584
  introspection_endpoint_auth_methods_supported: z.ZodOptional<z.ZodArray<z.ZodUnion<[z.ZodEnum<["client_secret_basic", "client_secret_post", "attest_jwt_client_auth", "client_secret_jwt", "private_key_jwt"]>, z.ZodString]>, "many">>;
7585
7585
  introspection_endpoint_auth_signing_alg_values_supported: z.ZodOptional<z.ZodArray<z.ZodEffects<z.ZodString, string, string>, "many">>;
7586
7586
  authorization_challenge_endpoint: z.ZodOptional<z.ZodEffects<z.ZodString, string, string>>;
7587
- pre_authorized_grant_anonymous_access_supported: z.ZodOptional<z.ZodBoolean>;
7587
+ 'pre-authorized_grant_anonymous_access_supported': z.ZodOptional<z.ZodBoolean>;
7588
7588
  client_attestation_pop_nonce_required: z.ZodOptional<z.ZodBoolean>;
7589
7589
  }, z.ZodTypeAny, "passthrough">;
7590
7590
 
@@ -9959,7 +9959,7 @@ declare class Oauth2AuthorizationServer {
9959
9959
  introspection_endpoint_auth_methods_supported: z.ZodOptional<z.ZodArray<z.ZodUnion<[z.ZodEnum<["client_secret_basic", "client_secret_post", "attest_jwt_client_auth", "client_secret_jwt", "private_key_jwt"]>, z.ZodString]>, "many">>;
9960
9960
  introspection_endpoint_auth_signing_alg_values_supported: z.ZodOptional<z.ZodArray<z.ZodEffects<z.ZodString, string, string>, "many">>;
9961
9961
  authorization_challenge_endpoint: z.ZodOptional<z.ZodEffects<z.ZodString, string, string>>;
9962
- pre_authorized_grant_anonymous_access_supported: z.ZodOptional<z.ZodBoolean>;
9962
+ 'pre-authorized_grant_anonymous_access_supported': z.ZodOptional<z.ZodBoolean>;
9963
9963
  client_attestation_pop_nonce_required: z.ZodOptional<z.ZodBoolean>;
9964
9964
  }, z.ZodTypeAny, "passthrough">;
9965
9965
  /**
@@ -11524,7 +11524,7 @@ declare class Oauth2Client {
11524
11524
  introspection_endpoint_auth_methods_supported: z.ZodOptional<z.ZodArray<z.ZodUnion<[z.ZodEnum<["client_secret_basic", "client_secret_post", "attest_jwt_client_auth", "client_secret_jwt", "private_key_jwt"]>, z.ZodString]>, "many">>;
11525
11525
  introspection_endpoint_auth_signing_alg_values_supported: z.ZodOptional<z.ZodArray<z.ZodEffects<z.ZodString, string, string>, "many">>;
11526
11526
  authorization_challenge_endpoint: z.ZodOptional<z.ZodEffects<z.ZodString, string, string>>;
11527
- pre_authorized_grant_anonymous_access_supported: z.ZodOptional<z.ZodBoolean>;
11527
+ 'pre-authorized_grant_anonymous_access_supported': z.ZodOptional<z.ZodBoolean>;
11528
11528
  client_attestation_pop_nonce_required: z.ZodOptional<z.ZodBoolean>;
11529
11529
  }, z.ZodTypeAny, "passthrough"> | null>;
11530
11530
  /**
package/dist/index.d.ts CHANGED
@@ -160,7 +160,7 @@ declare const zAuthorizationServerMetadata: z__default.ZodEffects<z__default.Zod
160
160
  introspection_endpoint_auth_methods_supported: z__default.ZodOptional<z__default.ZodArray<z__default.ZodUnion<[z__default.ZodEnum<["client_secret_basic", "client_secret_post", "attest_jwt_client_auth", "client_secret_jwt", "private_key_jwt"]>, z__default.ZodString]>, "many">>;
161
161
  introspection_endpoint_auth_signing_alg_values_supported: z__default.ZodOptional<z__default.ZodArray<z__default.ZodEffects<z__default.ZodString, string, string>, "many">>;
162
162
  authorization_challenge_endpoint: z__default.ZodOptional<z__default.ZodEffects<z__default.ZodString, string, string>>;
163
- pre_authorized_grant_anonymous_access_supported: z__default.ZodOptional<z__default.ZodBoolean>;
163
+ 'pre-authorized_grant_anonymous_access_supported': z__default.ZodOptional<z__default.ZodBoolean>;
164
164
  client_attestation_pop_nonce_required: z__default.ZodOptional<z__default.ZodBoolean>;
165
165
  }, "passthrough", z__default.ZodTypeAny, z__default.objectOutputType<{
166
166
  issuer: z__default.ZodEffects<z__default.ZodString, string, string>;
@@ -176,7 +176,7 @@ declare const zAuthorizationServerMetadata: z__default.ZodEffects<z__default.Zod
176
176
  introspection_endpoint_auth_methods_supported: z__default.ZodOptional<z__default.ZodArray<z__default.ZodUnion<[z__default.ZodEnum<["client_secret_basic", "client_secret_post", "attest_jwt_client_auth", "client_secret_jwt", "private_key_jwt"]>, z__default.ZodString]>, "many">>;
177
177
  introspection_endpoint_auth_signing_alg_values_supported: z__default.ZodOptional<z__default.ZodArray<z__default.ZodEffects<z__default.ZodString, string, string>, "many">>;
178
178
  authorization_challenge_endpoint: z__default.ZodOptional<z__default.ZodEffects<z__default.ZodString, string, string>>;
179
- pre_authorized_grant_anonymous_access_supported: z__default.ZodOptional<z__default.ZodBoolean>;
179
+ 'pre-authorized_grant_anonymous_access_supported': z__default.ZodOptional<z__default.ZodBoolean>;
180
180
  client_attestation_pop_nonce_required: z__default.ZodOptional<z__default.ZodBoolean>;
181
181
  }, z__default.ZodTypeAny, "passthrough">, z__default.objectInputType<{
182
182
  issuer: z__default.ZodEffects<z__default.ZodString, string, string>;
@@ -192,7 +192,7 @@ declare const zAuthorizationServerMetadata: z__default.ZodEffects<z__default.Zod
192
192
  introspection_endpoint_auth_methods_supported: z__default.ZodOptional<z__default.ZodArray<z__default.ZodUnion<[z__default.ZodEnum<["client_secret_basic", "client_secret_post", "attest_jwt_client_auth", "client_secret_jwt", "private_key_jwt"]>, z__default.ZodString]>, "many">>;
193
193
  introspection_endpoint_auth_signing_alg_values_supported: z__default.ZodOptional<z__default.ZodArray<z__default.ZodEffects<z__default.ZodString, string, string>, "many">>;
194
194
  authorization_challenge_endpoint: z__default.ZodOptional<z__default.ZodEffects<z__default.ZodString, string, string>>;
195
- pre_authorized_grant_anonymous_access_supported: z__default.ZodOptional<z__default.ZodBoolean>;
195
+ 'pre-authorized_grant_anonymous_access_supported': z__default.ZodOptional<z__default.ZodBoolean>;
196
196
  client_attestation_pop_nonce_required: z__default.ZodOptional<z__default.ZodBoolean>;
197
197
  }, z__default.ZodTypeAny, "passthrough">>, z__default.objectOutputType<{
198
198
  issuer: z__default.ZodEffects<z__default.ZodString, string, string>;
@@ -208,7 +208,7 @@ declare const zAuthorizationServerMetadata: z__default.ZodEffects<z__default.Zod
208
208
  introspection_endpoint_auth_methods_supported: z__default.ZodOptional<z__default.ZodArray<z__default.ZodUnion<[z__default.ZodEnum<["client_secret_basic", "client_secret_post", "attest_jwt_client_auth", "client_secret_jwt", "private_key_jwt"]>, z__default.ZodString]>, "many">>;
209
209
  introspection_endpoint_auth_signing_alg_values_supported: z__default.ZodOptional<z__default.ZodArray<z__default.ZodEffects<z__default.ZodString, string, string>, "many">>;
210
210
  authorization_challenge_endpoint: z__default.ZodOptional<z__default.ZodEffects<z__default.ZodString, string, string>>;
211
- pre_authorized_grant_anonymous_access_supported: z__default.ZodOptional<z__default.ZodBoolean>;
211
+ 'pre-authorized_grant_anonymous_access_supported': z__default.ZodOptional<z__default.ZodBoolean>;
212
212
  client_attestation_pop_nonce_required: z__default.ZodOptional<z__default.ZodBoolean>;
213
213
  }, z__default.ZodTypeAny, "passthrough">, z__default.objectInputType<{
214
214
  issuer: z__default.ZodEffects<z__default.ZodString, string, string>;
@@ -224,7 +224,7 @@ declare const zAuthorizationServerMetadata: z__default.ZodEffects<z__default.Zod
224
224
  introspection_endpoint_auth_methods_supported: z__default.ZodOptional<z__default.ZodArray<z__default.ZodUnion<[z__default.ZodEnum<["client_secret_basic", "client_secret_post", "attest_jwt_client_auth", "client_secret_jwt", "private_key_jwt"]>, z__default.ZodString]>, "many">>;
225
225
  introspection_endpoint_auth_signing_alg_values_supported: z__default.ZodOptional<z__default.ZodArray<z__default.ZodEffects<z__default.ZodString, string, string>, "many">>;
226
226
  authorization_challenge_endpoint: z__default.ZodOptional<z__default.ZodEffects<z__default.ZodString, string, string>>;
227
- pre_authorized_grant_anonymous_access_supported: z__default.ZodOptional<z__default.ZodBoolean>;
227
+ 'pre-authorized_grant_anonymous_access_supported': z__default.ZodOptional<z__default.ZodBoolean>;
228
228
  client_attestation_pop_nonce_required: z__default.ZodOptional<z__default.ZodBoolean>;
229
229
  }, z__default.ZodTypeAny, "passthrough">>;
230
230
  type AuthorizationServerMetadata = z__default.infer<typeof zAuthorizationServerMetadata>;
@@ -244,7 +244,7 @@ interface ClientAuthenticationDynamicOptions {
244
244
  * Only `client_secret_post`, `client_secret_basic`, and `none` supported.
245
245
  *
246
246
  * It also supports anonymous access to the token endpoint for pre-authorized code flow
247
- * if the authorization server has enabled `pre_authorized_grant_anonymous_access_supported`
247
+ * if the authorization server has enabled `pre-authorized_grant_anonymous_access_supported`
248
248
  */
249
249
  declare function clientAuthenticationDynamic(options: ClientAuthenticationDynamicOptions): ClientAuthenticationCallback;
250
250
  /**
@@ -7584,7 +7584,7 @@ declare function getAuthorizationServerMetadataFromList(authorizationServersMeta
7584
7584
  introspection_endpoint_auth_methods_supported: z.ZodOptional<z.ZodArray<z.ZodUnion<[z.ZodEnum<["client_secret_basic", "client_secret_post", "attest_jwt_client_auth", "client_secret_jwt", "private_key_jwt"]>, z.ZodString]>, "many">>;
7585
7585
  introspection_endpoint_auth_signing_alg_values_supported: z.ZodOptional<z.ZodArray<z.ZodEffects<z.ZodString, string, string>, "many">>;
7586
7586
  authorization_challenge_endpoint: z.ZodOptional<z.ZodEffects<z.ZodString, string, string>>;
7587
- pre_authorized_grant_anonymous_access_supported: z.ZodOptional<z.ZodBoolean>;
7587
+ 'pre-authorized_grant_anonymous_access_supported': z.ZodOptional<z.ZodBoolean>;
7588
7588
  client_attestation_pop_nonce_required: z.ZodOptional<z.ZodBoolean>;
7589
7589
  }, z.ZodTypeAny, "passthrough">;
7590
7590
 
@@ -9959,7 +9959,7 @@ declare class Oauth2AuthorizationServer {
9959
9959
  introspection_endpoint_auth_methods_supported: z.ZodOptional<z.ZodArray<z.ZodUnion<[z.ZodEnum<["client_secret_basic", "client_secret_post", "attest_jwt_client_auth", "client_secret_jwt", "private_key_jwt"]>, z.ZodString]>, "many">>;
9960
9960
  introspection_endpoint_auth_signing_alg_values_supported: z.ZodOptional<z.ZodArray<z.ZodEffects<z.ZodString, string, string>, "many">>;
9961
9961
  authorization_challenge_endpoint: z.ZodOptional<z.ZodEffects<z.ZodString, string, string>>;
9962
- pre_authorized_grant_anonymous_access_supported: z.ZodOptional<z.ZodBoolean>;
9962
+ 'pre-authorized_grant_anonymous_access_supported': z.ZodOptional<z.ZodBoolean>;
9963
9963
  client_attestation_pop_nonce_required: z.ZodOptional<z.ZodBoolean>;
9964
9964
  }, z.ZodTypeAny, "passthrough">;
9965
9965
  /**
@@ -11524,7 +11524,7 @@ declare class Oauth2Client {
11524
11524
  introspection_endpoint_auth_methods_supported: z.ZodOptional<z.ZodArray<z.ZodUnion<[z.ZodEnum<["client_secret_basic", "client_secret_post", "attest_jwt_client_auth", "client_secret_jwt", "private_key_jwt"]>, z.ZodString]>, "many">>;
11525
11525
  introspection_endpoint_auth_signing_alg_values_supported: z.ZodOptional<z.ZodArray<z.ZodEffects<z.ZodString, string, string>, "many">>;
11526
11526
  authorization_challenge_endpoint: z.ZodOptional<z.ZodEffects<z.ZodString, string, string>>;
11527
- pre_authorized_grant_anonymous_access_supported: z.ZodOptional<z.ZodBoolean>;
11527
+ 'pre-authorized_grant_anonymous_access_supported': z.ZodOptional<z.ZodBoolean>;
11528
11528
  client_attestation_pop_nonce_required: z.ZodOptional<z.ZodBoolean>;
11529
11529
  }, z.ZodTypeAny, "passthrough"> | null>;
11530
11530
  /**
package/dist/index.js CHANGED
@@ -1001,7 +1001,7 @@ var zAuthorizationServerMetadata = import_zod9.default.object({
1001
1001
  // FiPA (no RFC yet)
1002
1002
  authorization_challenge_endpoint: import_zod9.default.optional(import_utils12.zHttpsUrl),
1003
1003
  // From OpenID4VCI specification
1004
- pre_authorized_grant_anonymous_access_supported: import_zod9.default.optional(import_zod9.default.boolean()),
1004
+ "pre-authorized_grant_anonymous_access_supported": import_zod9.default.optional(import_zod9.default.boolean()),
1005
1005
  // Attestation Based Client Auth (draft 5)
1006
1006
  client_attestation_pop_nonce_required: import_zod9.default.boolean().optional()
1007
1007
  }).passthrough().refine(
@@ -1704,7 +1704,7 @@ function clientAuthenticationDynamic(options) {
1704
1704
  const { url, authorizationServerMetadata, body } = callbackOptions;
1705
1705
  const endpointType = url === authorizationServerMetadata.introspection_endpoint ? "introspection" : url === authorizationServerMetadata.token_endpoint ? "token" : "endpoint";
1706
1706
  const method = getSupportedClientAuthenticationMethod(authorizationServerMetadata, endpointType);
1707
- if (endpointType === "token" && body.grant_type === preAuthorizedCodeGrantIdentifier && authorizationServerMetadata.pre_authorized_grant_anonymous_access_supported) {
1707
+ if (endpointType === "token" && body.grant_type === preAuthorizedCodeGrantIdentifier && authorizationServerMetadata["pre-authorized_grant_anonymous_access_supported"]) {
1708
1708
  return clientAuthenticationAnonymous()(callbackOptions);
1709
1709
  }
1710
1710
  if (method === "client_secret_basic" /* ClientSecretBasic */) {
@@ -2335,7 +2335,7 @@ async function verifyAuthorizationRequestClientAttestation(options, authorizatio
2335
2335
  return void 0;
2336
2336
  }
2337
2337
  throw new Oauth2ServerErrorResponseError({
2338
- error: "invalid_dpop_proof" /* InvalidDpopProof */,
2338
+ error: "invalid_client" /* InvalidClient */,
2339
2339
  error_description: `Missing required client attestation parameters in pushed authorization request. Make sure to provide the '${oauthClientAttestationHeader}' and '${oauthClientAttestationPopHeader}' header values.`
2340
2340
  });
2341
2341
  }