Skip to content

Commit 11705c5

Browse files
cicnaviclaude
andcommitted
Hold issuance requests to HAIP's request rules (vci_haip)
A new option, vci_haip (default false), makes credential issuance follow the request rules of HAIP 1.0 and of the FAPI 2.0 Security Profile provisions it applies (HAIP section 4). They hold for issuance requests only, told by an issuer_state, a credential configuration scope or openid_credential authorization details, whatever their response_type. OpenID Connect and plain OAuth 2.0 requests keep their rules, and the discovery document does not change. With the option on, an issuance request has to be pushed: the authorization endpoint refuses one sent any other way, as require_pushed_authorization_requests does. It has to use the authorization code flow: the PAR endpoint refuses any other response_type with unsupported_response_type, before the rules and the DPoP proof, and the implicit grant does not serve one pushed before the option was on. It carries an S256 PKCE challenge, whichever client sends it. And it comes from a wallet which authenticates: none is refused at the PAR endpoint, at the token endpoint for a code of the issuance flow (by its stored flow type, the generic client's codes included), and for a pre-authorized code, self-declared and anonymous wallets included, which the metadata then states (pre-authorized_grant_anonymous_access_supported false). An issuance code lives 60 seconds, and a pushed issuance request 5 minutes, at most. In every flow, a token request without the code_verifier of a code issued with a code_challenge is now refused with invalid_grant instead of invalid_request (RFC 7636 section 4.6). The configuration overview shows the option, the configuration documentation has a section on it, and the compliance matrix rows move. Two stale statements go: the support note still listed x5c issuer keys as missing, and the conformance page client attestation as not supported. The check refusing a HAIP configuration which lacks a prerequisite comes separately. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Assisted-by: OpenAI Codex (gpt-6.1-sol, xhigh review)
1 parent 85b751e commit 11705c5

37 files changed

Lines changed: 1379 additions & 78 deletions

‎config/module_oidc.php.dist‎

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1181,7 +1181,8 @@ $config = [
11811181
* not set, OpenID Verifiable Credential capabilities will be disabled.
11821182
*
11831183
* The module is a Credential Issuer of OpenID4VCI 1.0, with the OP as its
1184-
* Authorization Server; the HAIP 1.0 profile is not supported. What is
1184+
* Authorization Server; the HAIP 1.0 profile is not supported as a whole
1185+
* (see OPTION_VCI_HAIP below). What is
11851186
* supported, and which requirements depend on the options below, is
11861187
* described in the module documentation, under "Note on OpenID for
11871188
* Verifiable Credential Issuance (OpenID4VCI) support" (docs/1-oidc.md).
@@ -1193,6 +1194,23 @@ $config = [
11931194
*/
11941195
ModuleConfig::OPTION_VCI_ENABLED => false,
11951196

1197+
/**
1198+
* (optional) Whether credential issuance follows HAIP 1.0, the OpenID4VC
1199+
* High Assurance Interoperability Profile, with the FAPI 2.0 provisions it
1200+
* applies. Defaults to false, and has no effect while issuance is
1201+
* disabled. It holds for issuance requests only, OpenID Connect requests
1202+
* being not affected: an issuance request has to be pushed (PAR), use the
1203+
* authorization code flow and PKCE with S256, and the wallet has to
1204+
* authenticate at the PAR and token endpoints (none is refused, for a
1205+
* pre-authorized code too, whatever
1206+
* OPTION_VCI_ALLOW_ANONYMOUS_PRE_AUTHORIZED_ACCESS says). An issuance code
1207+
* lives 60 seconds, and a pushed issuance request 5 minutes, at most.
1208+
* HAIP also has every access token bound to a key of the wallet: set
1209+
* OPTION_VCI_REQUIRE_DPOP as well. See "HAIP 1.0" in the configuration
1210+
* documentation (docs/3-oidc-configuration.md).
1211+
*/
1212+
// ModuleConfig::OPTION_VCI_HAIP => false,
1213+
11961214
/**
11971215
* Verifiable Credential signature algorithm and key-pair definitions,
11981216
* representing supported algorithms for signing verifiable credentials.
@@ -1951,6 +1969,8 @@ $config = [
19511969
* `pre-authorized_grant_anonymous_access_supported`. When false, such a
19521970
* token request is refused with invalid_client; a wallet which sends its
19531971
* `client_id`, registered or not, or authenticates, is still accepted.
1972+
* While issuance follows HAIP (OPTION_VCI_HAIP), no anonymous access is
1973+
* served, and the metadata says so, whatever this option is.
19541974
*/
19551975
// ModuleConfig::OPTION_VCI_ALLOW_ANONYMOUS_PRE_AUTHORIZED_ACCESS => true,
19561976

‎conformance-tests/openid4vci-1_0-compliance.md‎

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -192,16 +192,16 @@ formats below (row 45). A request using one anyway is refused, except where note
192192
|---|------------------------|--------|-------|
193193
| 67 | Support the authorization code flow (§4). | Met | `AuthCodeGrantTest::testSpendsTheIssuerStateOfACredentialOfferCodeAndCarriesItOntoTheToken`. |
194194
| 68 | Support the IETF SD-JWT VC profile of §6 (§3, §4). | Partial | `dc+sd-jwt` is issued; the §6.1 requirements below are not all met. |
195-
| 69 | Comply with the applicable FAPI 2.0 provisions: PKCE with S256, PAR where the authorization endpoint is used, `iss` in the authorization response (§4). | Partial | See the FAPI 2.0 section. |
195+
| 69 | Comply with the applicable FAPI 2.0 provisions: PKCE with S256, PAR where the authorization endpoint is used, `iss` in the authorization response (§4). | Partial | See the FAPI 2.0 section: PKCE with S256 and PAR are required of issuance requests with `vci_haip` (rows 99, 100). |
196196
| 70 | Support DPoP (§4). | Met; Config | Required for issuance with `vci_require_dpop` (default `false`). |
197197
| 71 | Issuer-initiated flows use the Credential Offer, same-device and cross-device (§4, §4.2). | Met | The offer API returns the offer URI; presenting it as a link or a QR code is the caller's; the admin test page draws its QR code itself. `VciCredentialOfferApiControllerTest::testBuildsAnOfferForTheAuthorizationCodeFlow`. |
198198
| 72 | Batch issuance support is stated by including or omitting `batch_credential_issuance` (§4). | Met | Row 42. |
199199
| 73 | AS metadata per RFC 8414; issuer metadata per OpenID4VCI §12.2.2 (§4.1). | Met | `OAuth2ServerConfigurationControllerTest::testItServesTheOpMetadataAsIs`; row 39. |
200200
| 74 | A `scope` for every Credential Configuration (§4.1); for the authorization code grant, a scope value lets the wallet identify the credential (§4.2). | Config (H-G9) | `scope` is optional in `vci_credential_configurations_supported` (when present it must equal the configuration id). OpenID4VCI 1.0 offers have no `scope` member, so the wallet takes it from the metadata. |
201201
| 75 | `nonce_endpoint` is present when a configuration requires key binding (§4.1). | Met | Row 25. |
202-
| 76 | Wallets authenticate at the PAR endpoint as at the token endpoint (§4.3). | Gap (H-G1) | The PAR endpoint authenticates clients as the token endpoint does, Wallet Attestation included (`AuthenticatedOAuth2ClientResolver::forClientAttestation()`, `AuthenticatedOAuth2ClientResolverTest::testForAnySupportedMethodResolvesARealAttestation`), but public clients and non-registered wallets push unauthenticated (row 78). |
202+
| 76 | Wallets authenticate at the PAR endpoint as at the token endpoint (§4.3). | Met; Config (H-G1) | The PAR endpoint authenticates clients as the token endpoint does, Wallet Attestation included (`AuthenticatedOAuth2ClientResolver::forClientAttestation()`, `AuthenticatedOAuth2ClientResolverTest::testForAnySupportedMethodResolvesARealAttestation`). With `vci_haip` (default `false`) it refuses `none` for an issuance request (`PushedAuthorizationControllerTest::testRefusesAPublicClientPushingAnIssuanceRequestWhileIssuanceFollowsHaip`); OpenID Connect requests keep it (`testLetsAPublicClientPushARequestWhichIsNotForIssuance`). A wallet which is not registered can not push at all. |
203203
| 77 | Refresh tokens are RECOMMENDED for credential refresh; consider how long they may refresh a credential (§4.4). | Not implemented | Credential refresh is not implemented. No refresh token is issued in an issuance flow, even for `offline_access` (`AuthCodeGrant::respondToAccessTokenRequest()`, tested in `AuthCodeGrantTest::testIssuesNoRefreshTokenForACodeOfACredentialIssuanceFlow`); the pre-authorized code grant issues none. The access token a refresh yields would not keep the issuance flow, so the Credential Endpoint would refuse it. |
204-
| 78 | Issuers MUST require client authentication at the PAR and token endpoints (§4.4.1). | Gap (H-G1) | Wallet Attestation (OpenID4VCI Appendix E, attestation-based client authentication draft 07) is implemented for registered clients (`ClientAttestationVerifier`, `ClientAttestationVerifierTest`), but nothing requires client authentication: public clients, non-registered wallets and anonymous pre-authorized code requests are served without it. |
204+
| 78 | Issuers MUST require client authentication at the PAR and token endpoints (§4.4.1). | Met; Config (H-G1) | Wallet Attestation (OpenID4VCI Appendix E, attestation-based client authentication draft 07) is implemented for registered clients (`ClientAttestationVerifier`, `ClientAttestationVerifierTest`). With `vci_haip` (default `false`), `none` is refused at the PAR endpoint (row 76), at the token endpoint for a code of the issuance flow, by its stored flow type (`AuthCodeGrantTest::testRefusesAClientWhichDoesNotAuthenticateForAnIssuanceCodeWhileIssuanceFollowsHaip`, `testRefusesAnIssuanceCodeOfTheGenericClientWhileIssuanceFollowsHaip`), and for a pre-authorized code, self-declared and anonymous wallets included (`PreAuthorizedCodeClientRuleTest::testRefusesARegisteredClientWithoutCredentialsWhileIssuanceFollowsHaip`, `testRefusesAWalletWhichIsNotRegisteredWhileIssuanceFollowsHaip`). Without it, public clients, non-registered wallets and anonymous pre-authorized code requests are served without client authentication. |
205205
| 79 | Key attestations, with `x5c` chains excluding the trust anchor, not self-signed (§4.5.1). | Not implemented (H-G4) | Wallets MUST support them; issuers evaluate them where the ecosystem requires. |
206206
| 80 | Compact serialization of SD-JWT VCs (§6.1). | Met | `CredentialIssuerCredentialControllerTest::testAnswersEachCredentialAsTheStringItWasSerializedTo` (row 35). |
207207
| 81 | It is RECOMMENDED to limit the validity of SD-JWT VCs, and a limited one uses `exp`, `status` or both (§6.1). | Config | Credential lifetimes per configuration (`vci_credential_ttls`, none by default); status lists when enabled (off by default). |
@@ -227,18 +227,18 @@ rows on confidential clients only, client authentication methods and the `aud` o
227227
| 90 | Discovery metadata; no resource owner password credentials grant (§5.3.2.1). | Met; the refusal untested | `OpMetadataServiceTest::testItReturnsExpectedMetadata` (the advertised grants); the password grant is never registered (`AuthorizationServerFactory`). |
228228
| 91 | No open redirectors (§5.3.2.1). | Met; Config | `ClientRedirectUriRule` matches the registered redirect URIs exactly, a registered client's in a credential request too. With `vci_allow_non_registered_clients`, a non-registered wallet's credential request carrying `issuer_state` may use a redirect URI starting with one of `vci_allowed_redirect_uri_prefixes_for_non_registered_clients` (default `openid-credential-offer://`); the admin overview warns about an `https` or `http` prefix which ends in the host name, and so also matches other hosts. `ClientRedirectUriRuleTest`: `testMatchesTheRegisteredListExactlyRatherThanByPrefix`, `testHoldsARegisteredClientToItsRegisteredRedirectUrisInACredentialRequestToo`; `VciOverviewBuilderTest::testWarnsAboutAPrefixWhichEndsInTheHostName`. |
229229
| 92 | Only sender-constrained access tokens, by DPoP or MTLS (§5.3.2.1). | Config (H-G10) | `vci_require_dpop` (default `false`). MTLS is not implemented. |
230-
| 93 | Authorization codes live at most 60 seconds (§5.3.2.1). | Config (H-G10) | `authCodeDuration`, default `PT10M`. |
230+
| 93 | Authorization codes live at most 60 seconds (§5.3.2.1). | Met; Config (H-G10) | With `vci_haip`, an issuance code lives 60 seconds at most (`AuthCodeGrant::VCI_HAIP_AUTH_CODE_MAX_TTL`, `AuthCodeGrantTest::testIssuesTheCodeWithTheLifetimeOfItsFlow`); other codes, and issuance codes without it, live `authCodeDuration`, default `PT10M`. |
231231
| 94 | Authorization code binding to the DPoP key (§5.3.2.1). | Met | `dpop_jkt`. `AuthCodeGrantTest`: `testRedeemsACodeBoundToAKeyWithAProofByThatKey`, `testRefusesACodeBoundToAKeyWithoutAProofByThatKey`. |
232232
| 95 | Accept JWTs with an `iat` or `nbf` up to 10 seconds ahead, refuse more than 60 (§5.3.2.1). | Met for DPoP proofs; Config otherwise | `DpopProofVerifierTest::testHoldsTheIssuedAtToAMinuteEitherWay`; the library's `ParsedJwsTest::testHoldsNotBeforeAndIssuedAtAgainstTheClockWithTheirFractions`. Other JWTs are held to `timestamp_validation_leeway` (default one minute), which has to stay between 10 and 60 seconds. |
233233
| 96 | Access token privileges are the minimum needed (§5.3.2.1, should). | Config | Per client: the scopes it may have. |
234234
| 97 | No refresh token rotation except in extraordinary circumstances, and then with a retry window (§5.3.2.1). | Gap (H-G6) | `RefreshTokenGrant` rotates the refresh token on every use and revokes the old one at once. |
235-
| 98 | `response_type` `code` only (§5.3.2.2). | Config | Per client (`response_types`) and `enabled_grant_types`. |
236-
| 99 | Client-authenticated PAR; authorization requests without PAR are refused (§5.3.2.2). | Partial; Config (H-G1, H-G10) | PAR is required with `require_pushed_authorization_requests` (default `false`); public clients push unauthenticated (row 78). |
237-
| 100 | PKCE with S256 required (§5.3.2.2). | Gap (H-G5) | `plain` is accepted and advertised (`code_challenge_methods_supported`), and PKCE is optional for confidential clients. |
235+
| 98 | `response_type` `code` only (§5.3.2.2). | Met; Config | With `vci_haip`, an issuance request for another response type is refused at the PAR endpoint (`unsupported_response_type`, `PushedAuthorizationControllerTest::testRefusesAnIssuanceRequestForAnotherResponseTypeWhileIssuanceFollowsHaip`) and not served by the implicit grant (`ImplicitGrantTest::testDoesNotRespondToAnIssuanceRequestWhileIssuanceFollowsHaip`). Other requests: per client (`response_types`) and `enabled_grant_types`. |
236+
| 99 | Client-authenticated PAR; authorization requests without PAR are refused (§5.3.2.2). | Met; Config (H-G1, H-G10) | With `vci_haip`, an issuance request is refused without PAR (`RequestUriRuleTest::testRequiresParForAnIssuanceRequestWhileIssuanceFollowsHaip`, `testRefusesAnIssuanceRequestByReferenceWhileIssuanceFollowsHaip`) and pushed only with client authentication (row 76). Other requests need PAR with `require_pushed_authorization_requests` (default `false`). |
237+
| 100 | PKCE with S256 required (§5.3.2.2). | Met; Config (H-G5) | With `vci_haip`, an issuance request needs a challenge from every client (`CodeChallengeRuleTest::testRefusesAConfidentialClientWhichSendsNoCodeChallengeForIssuanceFollowingHaip`) and `S256` (`CodeChallengeMethodRuleTest::testRefusesAMethodOtherThanS256ForIssuanceFollowingHaip`). `plain` stays advertised (`code_challenge_methods_supported`, shared with OpenID Connect), and other requests may use it, confidential clients without PKCE. A token request without the `code_verifier` is `invalid_grant` in every flow (`AuthCodeGrantTest::testRequiresCodeVerifierWhenAuthorizationRequestUsedCodeChallenge`, `CodeVerifierRuleTest::testRejectsAPublicClientThatSendsNoCodeVerifier`). |
238238
| 101 | `redirect_uri` required in PAR; `iss` in the authorization response; a used code is refused (§5.3.2.2). | Met | `ClientRedirectUriRuleTest::testRejectsARequestWithoutARedirectUri`; `AuthCodeGrantTest::testNamesItselfAsTheIssuerInTheAuthorizationResponse`, `testRevokesRelatedTokensWhenAuthorizationCodeIsReplayed`. |
239239
| 102 | No `http` redirect URIs except native loopback (§5.3.2.2). | Gap (H-G8) | `ClientMetadataValidator` holds web clients to https only when they use the implicit grant. |
240240
| 103 | No HTTP 307 for redirects; 303 SHOULD be used (§5.3.2.2). | Partial (H-G11) | Redirects use 302. |
241-
| 104 | PAR `expires_in` less than 600 seconds (§5.3.2.2). | Config (H-G10) | `par_request_uri_ttl`, default `PT10M`, which is 600 seconds exactly. |
241+
| 104 | PAR `expires_in` less than 600 seconds (§5.3.2.2). | Met; Config (H-G10) | With `vci_haip`, a pushed issuance request lives 300 seconds at most (`PushedAuthorizationController::VCI_HAIP_REQUEST_URI_MAX_TTL`, `PushedAuthorizationControllerTest::testCapsTheLifetimeOfAnIssuanceRequestWhileIssuanceFollowsHaip`, `PushedAuthorizationRequestEntityFactoryTest::testBuildsNewWithTheShorterOfTheConfiguredAndTheMaximumLifetime`); others live `par_request_uri_ttl`, default `PT10M`, which is 600 seconds exactly. |
242242
| 105 | With OpenID Connect, `nonce` values up to 64 characters are supported (§5.3.2.2), and the user's identifier reaches the client in an ID Token (§5.3.2.3). | Met; the nonce length untested | The nonce is not length-limited. `TokenResponseTest::testCarriesBothTheIdTokenAndTheAuthorizationDetailsWhenTheVciFlowRequestedOpenid`. |
243243
| 106 | Resource server: tokens in the header, never in the query; validity, expiry, revocation, sufficiency and sender constraint checked (§5.3.4). | Met, untested in part | `BearerTokenValidatorTest`: `testValidatesForAuthorizationHeader`, `testRefusesARevokedAccessTokenAsAnInvalidToken`, `testAcceptsATokenUnderTheDpopSchemeWithAProofByTheKeyItIsBoundTo`, `testRefusesABoundTokenPresentedAsABearerToken`. The query refusal and the expiry check have no test of their own here; an insufficient token gets its challenge (row 36). |
244244
| 107 | RSA keys of at least 2048 bits; EC keys of at least 224 bits (§5.4.1). | Partial (H-G11) | The openid library refuses a shorter RSA key in a DPoP proof; other RSA keys (clients', the OP's own) are not checked. The supported curves are all 256 bits or more. |
@@ -254,17 +254,17 @@ OpenID4VCI 1.0 (the base specification):
254254

255255
HAIP 1.0 and the FAPI 2.0 provisions it applies:
256256

257-
- **H-G1** Client authentication is not required at the PAR and token endpoints, though Wallet Attestation is
258-
implemented for registered clients (rows 76, 78, 99).
257+
- **H-G1** Client authentication is required at the PAR and token endpoints only with `vci_haip`; Wallet
258+
Attestation is implemented for registered clients (rows 76, 78, 99).
259259
- **H-G2** `x5c` (X.509) issuer keys depend on configuration: nothing requires a certificate chain on the signing
260260
key, nor the `x509` key profile for Status List Tokens (rows 84, 85).
261261
- **H-G3** `cnf.kid` instead of `cnf.jwk` for DID-bound keys (row 82).
262262
- **H-G4** No key attestations (rows 52, 64, 79).
263-
- **H-G5** PKCE `plain` accepted; PKCE optional for confidential clients (row 100).
263+
- **H-G5** PKCE `plain` accepted, and PKCE optional for confidential clients, unless `vci_haip` (row 100).
264264
- **H-G6** Refresh tokens rotate on every use (row 97).
265265
- **H-G7** CORS at the authorization endpoint (row 89).
266266
- **H-G8** `http` redirect URIs allowed for code flow web clients (row 102).
267267
- **H-G9** `scope` optional per Credential Configuration (row 74).
268-
- **H-G10** Defaults outside FAPI 2.0: codes live 10 minutes, PAR not required, PAR URIs live 600 seconds,
269-
DPoP not required (rows 92, 93, 99, 104).
268+
- **H-G10** Defaults outside FAPI 2.0: codes live 10 minutes, PAR not required, PAR URIs live 600 seconds, unless
269+
`vci_haip`; DPoP not required, whatever `vci_haip` says (rows 92, 93, 99, 104).
270270
- **H-G11** 302 redirects; RSA key length checked only in DPoP proofs (rows 103, 107).

‎docs/1-oidc.md‎

Lines changed: 14 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -193,15 +193,20 @@ with the OP as its Authorization Server. What that covers:
193193
types, and the `x5c` header of `jwt` proofs (a key proof naming its key by a
194194
certificate is refused); key attestations.
195195
- **The OpenID4VC High Assurance Interoperability Profile (HAIP 1.0) is not
196-
supported.** Among what it requires of an issuer and the module lacks:
197-
client authentication of every wallet at the PAR and token endpoints (public
198-
clients, non-registered wallets and anonymous pre-authorized code requests
199-
are served without it); X.509 (`x5c`) keys for credentials and Status List
200-
Tokens; the holder's key in `cnf.jwk` whatever the proof named it by; and
201-
several FAPI 2.0 provisions. Wallets registered for it can authenticate
202-
with a Wallet Attestation, as HAIP has them, but nothing requires it. Nor
203-
does the module evaluate the key attestations HAIP leaves to ecosystems to
204-
require. The same
196+
supported as a whole.** With `vci_haip`, issuance requests are held to its
197+
request rules (see
198+
[HAIP 1.0](3-oidc-configuration.md#haip-10-vci_haip)): pushed, in the
199+
authorization code flow, with PKCE `S256`, from a wallet which authenticates
200+
at the PAR and token endpoints (with a Wallet Attestation, for wallets
201+
registered for it), and with 60-second codes. Credentials and Status List
202+
Tokens can carry X.509 (`x5c`) certificate chains. Among what HAIP requires
203+
of an issuer and the module lacks: the refusal of a configuration HAIP can
204+
not work with (DPoP not required, a credential configuration without a
205+
`scope`, a signing key without a certificate chain); the holder's key in
206+
`cnf.jwk` whatever the proof named it by; and the other FAPI 2.0 provisions
207+
(no CORS at the authorization endpoint, no `http` redirect URIs but native
208+
loopback ones, 303 redirects, RSA key lengths). Nor does the module evaluate
209+
the key attestations HAIP leaves to ecosystems to require. The same
205210
document lists all of these as gaps H-G1 to H-G11. The OpenID Foundation
206211
certifies OpenID4VCI issuers through its HAIP issuer test plan, so the module
207212
can not be certified as it stands; CI runs the foundation's base 1.0 issuer

0 commit comments

Comments
 (0)