Skip to content

Commit ef21152

Browse files
cicnaviclaude
andcommitted
Refuse a credential configuration's name and scope wherever configurations are checked
While issuance is enabled, each credential configuration id becomes the scope a grant of the credential is held under. ModuleConfig::getVciScopes() refused a configuration named after a standard OpenID Connect scope, one whose id is not an RFC 6749 scope-token, and one stating a `scope` other than its id, so discovery, registration and authorization failed on it. The Credential Issuer metadata, credential offers and the Credential Endpoint asked only whether a configuration could be issued as it stands, so the metadata advertised a scope which authorization then refused, and an offer could still be made. The three checks are now faults of the configuration (findFaultInVciCredentialConfiguration()), which getVciScopes(), the metadata, offers, the admin test page, the Credential Endpoint and the configuration overview all ask for. The Credential Endpoint therefore no longer issues under such a configuration either, for instance to a token granting a standard scope a configuration has since been named after. The overview drops its own copies of two of the checks (the standard-scope name and the mismatched scope) and their warnings: the configuration is marked with the fault, under the general warning. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
1 parent 5193638 commit ef21152

15 files changed

Lines changed: 167 additions & 223 deletions

File tree

‎config/module_oidc.php.dist‎

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1420,10 +1420,11 @@ $config = [
14201420
* descriptions as OpenID4VCI 1.0 Appendix B has them (each `path` a claims
14211421
* path pointer, no claim described twice). `claims` and `display` belong in
14221422
* `credential_metadata`, not at the top level of the configuration. A
1423-
* configuration which is not issuable is refused, and with it the whole
1424-
* scope list and the Credential Issuer metadata, so discovery,
1425-
* registration, authorization, credential offers and issuance fail until
1426-
* it is corrected; the configuration overview names the fault.
1423+
* configuration which is not issuable, or breaks a rule of the paragraph
1424+
* above, is refused, and with it the whole scope list and the Credential
1425+
* Issuer metadata, so discovery, registration, authorization, credential
1426+
* offers and issuance fail until it is corrected; the configuration
1427+
* overview names the fault.
14271428
*
14281429
* A claim marked `mandatory` is one the issuer always includes. So a
14291430
* configuration with one that nothing writes, neither the issuer itself

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,7 @@ Status values:
132132
| 41 | `credential_issuer` equals the identifier, an https URL without query or fragment (§12.2.1, §12.2.4, §4.1.1); `credential_endpoint` and `nonce_endpoint` use https (§12.2.4). | Met; the URL's form is Config | `CredentialIssuerMetadataService`: the identifier is the `issuer` option, checked only for being set, and the endpoints are the module's own URLs (SimpleSAMLphp's base URL). | `CredentialIssuerMetadataServiceTest::testPublishesTheIssuerAndItsEndpoints`. |
133133
| 42 | `batch_credential_issuance.batch_size` is 2 or more, and states the cap enforced (§12.2.4; HAIP §4). | Met | `CredentialIssuerMetadataService` (`ModuleConfig::VCI_BATCH_SIZE`, 8; omitted when no configuration is proof bound); the cap: row 29. | `CredentialIssuerMetadataServiceTest`: `testPublishesTheBatchSizeItActuallyEnforces`, `testAProoflessConfigurationAdvertisesNoBindingAtAll`. |
134134
| 43 | Issuer `display` (§12.2.4). | Met | `CredentialIssuerMetadataService::buildIssuerDisplay()`. | `CredentialIssuerMetadataServiceTest`: `testDescribesItselfToWalletsFromTheCommonMetadata`, `testLeavesOutWhatIsNotConfiguredFromItsDisplay`, `testPublishesNoDisplayWithNothingToDisplay`. |
135-
| 44 | Each configuration's `scope`, `credential_signing_alg_values_supported` (IANA JOSE identifiers), and `cryptographic_binding_methods_supported` with `proof_types_supported` (both or neither) (§12.2.4, A.1.1.2, A.3.2, F.1). | Met | `CredentialIssuerMetadataService`: the active signing key's algorithm only; only the binding methods the issuer accepts. | `CredentialIssuerMetadataServiceTest`: `testDescribesWhatEachConfigurationCanBeProvedAndSignedWith`, `testAdvertisesTheAlgorithmOfTheActiveSigningKeyOnly`, `testAProoflessConfigurationAdvertisesNoBindingAtAll`, `testADiipConfigurationAdvertisesOnlyTheMethodsItAccepts`, `testAMethodTheRegistryCanNotResolveIsNotAdvertised`. |
135+
| 44 | Each configuration's `scope`, `credential_signing_alg_values_supported` (IANA JOSE identifiers), and `cryptographic_binding_methods_supported` with `proof_types_supported` (both or neither) (§12.2.4, A.1.1.2, A.3.2, F.1). | Met | `CredentialIssuerMetadataService`: the active signing key's algorithm only; only the binding methods the issuer accepts; no `scope` other than the configuration's id, which a credential is granted under: such a configuration is refused, and with it the whole document, as discovery and offers refuse it (`ModuleConfig::findFaultInVciCredentialConfiguration()`). | `CredentialIssuerMetadataServiceTest`: `testDescribesWhatEachConfigurationCanBeProvedAndSignedWith`, `testAdvertisesTheAlgorithmOfTheActiveSigningKeyOnly`, `testAProoflessConfigurationAdvertisesNoBindingAtAll`, `testADiipConfigurationAdvertisesOnlyTheMethodsItAccepts`, `testAMethodTheRegistryCanNotResolveIsNotAdvertised`; `ModuleConfigTest::testRefusesAConfigurationWhichCanNotBeGrantedWhereverTheConfigurationsAreChecked`. |
136136
| 45 | Each configuration's `format` is one the issuer supports, with the members its profile requires (`credential_definition.type` for `jwt_vc_json`, `vct` for `dc+sd-jwt`); `credential_metadata` `display` (one object per language) and `claims` (each `path` a non-empty claims path pointer; a `mandatory` claim always included) (§12.2.4, A.1.1.2, A.3.2, B.2). | Met | `ModuleConfig::findFaultInVciCredentialConfiguration()` refuses, where the configurations become scopes (`getVciScopes()`) and before the Credential Issuer metadata is built (`CredentialIssuerMetadataService`), a configuration whose format the issuer can not issue, one without `vct` (`dc+sd-jwt`) or `credential_definition.type` (`jwt_vc_json`, and `vc+sd-jwt`, which issues it as its `type`), display objects which are not non-empty objects one with a name for each language, an empty `credential_metadata`, `claims` or `display` at the top level (the pre-final layout), and claims descriptions against Appendix B (`ClaimsDescriptionValidator`, shared with row 11); the Credential Endpoint does not issue under such a configuration either (`server_error`), and the configuration overview names the fault. A configuration with a `mandatory` claim nothing writes, neither the issuer itself (`CredentialClaimLocator::ISSUER_WRITTEN_CLAIM_PATHS`, as `credentialSubject.id`) nor an attribute mapped to it or to a claim around or inside it (`vci_user_attribute_to_credential_claim_path_map`, read where the format puts the mapped value), is refused the same way. At issuance every mandatory claim the issuer does not write is judged by what the mapping wrote, where the format puts it in the credential, and a user whose attributes leave one out is refused with `credential_request_denied` (`CredentialIssuerCredentialController`). In both checks a pointer with a null or an index is judged by the members before it, and one which starts with one names nothing the credential could hold. | `ModuleConfigTest`: `testRefusesACredentialConfigurationWhichCanNotBeIssuedAsItStands`, `testAcceptsACredentialConfigurationWhichCanBeIssuedAsItStands`, `testRefusesAConfigurationWithAMandatoryClaimNothingWrites`, `testAcceptsAConfigurationWhoseMandatoryClaimsAreWritten`; `CredentialIssuerMetadataServiceTest::testPublishesNothingWhileACredentialConfigurationCanNotBeIssued`; `CredentialIssuerCredentialControllerTest`: `testRefusesToIssueUnderAConfigurationWhichCanNotBeIssuedAsItStands`, `testRefusesAUserWithoutTheAttributeOfAMandatoryClaim`, `testRefusesAMandatoryClaimWhichTheMappingsAroundOrInsideItLeaveOut`, `testJudgesAMandatoryPointerToArrayElementsByTheMembersBeforeIt`, `testComparesAMandatoryClaimWithWhereTheFormatPutsTheMappedAttribute`, `testIssuesAMandatoryClaimFromWhicheverAttributeTheUserHas`, `testDoesNotJudgeAMandatoryClaimTheIssuerWrites`, `testTheIssuerWrittenClaimPathsListEveryClaimTheIssuerWrites`; `CredentialClaimLocatorTest`; `VciOverviewBuilderTest::testFlagsUnsupportedCredentialFormat`. |
137137
| 46 | When a configuration has no `scope`, the AS metadata lists `openid_credential` in `authorization_details_types_supported`, `authorization_details` being the only way to request it (§12.2.4). | Met | `OpMetadataService` publishes `authorization_details_types_supported` (`openid_credential`) while issuance is enabled, and leaves the id of a configuration without a `scope` out of `scopes_supported`; `ScopeRule` ignores that id as a scope value, as one it does not support (`ModuleConfig::getVciCredentialConfigurationIdsWithoutScope()`, row 12). Inside the module the id stays the scope a grant of the credential is held under. | `OpMetadataServiceTest`: `testAdvertisesTheOpenIdCredentialAuthorizationDetailsTypeWhileIssuing`, `testDoesNotAdvertiseTheIdOfACredentialConfigurationWithoutAScope`; `ScopeRuleTest::testIgnoresTheIdOfACredentialConfigurationWithoutAScope`; `ModuleConfigTest::testListsTheCredentialConfigurationsWhichStateNoScope`. |
138138
| 47 | The AS can tell from the metadata which claims a credential discloses, for meaningful consent (§12.2.4); consent is obtained, explaining what the credential contains and for what purpose (§15.1, SHOULD), and which client asks for which scopes (FAPI 2.0 §5.3.2.2, should). | Config (G8) | The AS and the issuer are one; the module renders no consent of its own, leaving it to SimpleSAMLphp authentication processing filters, which are given the client and the requested scopes, and the user's attributes rather than the credential's claims. | - |

‎docs/3-oidc-configuration.md‎

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1126,9 +1126,11 @@ Since the id is the scope a credential is granted under, a credential
11261126
configuration's optional `scope`, which the Credential Issuer metadata
11271127
publishes for wallets to request, is either left out or equal to the id. A
11281128
configuration stating another scope (even one OpenID4VCI would allow, such as
1129-
a scope shared by several configurations) is refused when the scopes are read,
1130-
like an id outside that grammar, rather than advertised and then refused at
1131-
authorization.
1129+
a scope shared by several configurations) is refused, like an id outside that
1130+
grammar, wherever the configurations are checked: when the scopes are read,
1131+
before the Credential Issuer metadata is published and before a credential
1132+
offer is made. So it is never advertised and then refused at authorization,
1133+
and the Credential Endpoint does not issue under it either.
11321134

11331135
A configuration which leaves its `scope` out is requested through
11341136
`authorization_details` only (OpenID4VCI 1.0 section 12.2.4): its id is

‎locales/en/LC_MESSAGES/oidc.po‎

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1374,27 +1374,12 @@ msgid ""
13741374
"default attribute above. Such entries are not listed here."
13751375
msgstr ""
13761376

1377-
msgid ""
1378-
"At least one credential configuration is named after a standard OpenID "
1379-
"Connect scope (openid, offline_access, profile, email, address, phone). "
1380-
"Such a name is refused, and with it the whole scope list, so discovery, "
1381-
"registration and authorization fail until it is renamed."
1382-
msgstr ""
1383-
13841377
msgid ""
13851378
"At least one credential configuration has a missing or unsupported "
13861379
"format, so it cannot issue credentials at all. Supported formats are "
13871380
"jwt_vc_json, dc+sd-jwt and vc+sd-jwt."
13881381
msgstr ""
13891382

1390-
msgid ""
1391-
"At least one credential configuration states a scope other than its own "
1392-
"id. The id is the scope a credential is granted under, so the stated one "
1393-
"would be advertised and then refused. Such a configuration is refused, and "
1394-
"with it the whole scope list, so discovery, registration and authorization "
1395-
"fail until the scope is left out or made equal to the id."
1396-
msgstr ""
1397-
13981383
msgid "Attribute read to find the address a credential offer is sent to."
13991384
msgstr ""
14001385

‎locales/es/LC_MESSAGES/oidc.po‎

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1374,27 +1374,12 @@ msgid ""
13741374
"default attribute above. Such entries are not listed here."
13751375
msgstr ""
13761376

1377-
msgid ""
1378-
"At least one credential configuration is named after a standard OpenID "
1379-
"Connect scope (openid, offline_access, profile, email, address, phone). "
1380-
"Such a name is refused, and with it the whole scope list, so discovery, "
1381-
"registration and authorization fail until it is renamed."
1382-
msgstr ""
1383-
13841377
msgid ""
13851378
"At least one credential configuration has a missing or unsupported "
13861379
"format, so it cannot issue credentials at all. Supported formats are "
13871380
"jwt_vc_json, dc+sd-jwt and vc+sd-jwt."
13881381
msgstr ""
13891382

1390-
msgid ""
1391-
"At least one credential configuration states a scope other than its own "
1392-
"id. The id is the scope a credential is granted under, so the stated one "
1393-
"would be advertised and then refused. Such a configuration is refused, and "
1394-
"with it the whole scope list, so discovery, registration and authorization "
1395-
"fail until the scope is left out or made equal to the id."
1396-
msgstr ""
1397-
13981383
msgid "Attribute read to find the address a credential offer is sent to."
13991384
msgstr ""
14001385

‎locales/fr/LC_MESSAGES/oidc.po‎

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1374,27 +1374,12 @@ msgid ""
13741374
"default attribute above. Such entries are not listed here."
13751375
msgstr ""
13761376

1377-
msgid ""
1378-
"At least one credential configuration is named after a standard OpenID "
1379-
"Connect scope (openid, offline_access, profile, email, address, phone). "
1380-
"Such a name is refused, and with it the whole scope list, so discovery, "
1381-
"registration and authorization fail until it is renamed."
1382-
msgstr ""
1383-
13841377
msgid ""
13851378
"At least one credential configuration has a missing or unsupported "
13861379
"format, so it cannot issue credentials at all. Supported formats are "
13871380
"jwt_vc_json, dc+sd-jwt and vc+sd-jwt."
13881381
msgstr ""
13891382

1390-
msgid ""
1391-
"At least one credential configuration states a scope other than its own "
1392-
"id. The id is the scope a credential is granted under, so the stated one "
1393-
"would be advertised and then refused. Such a configuration is refused, and "
1394-
"with it the whole scope list, so discovery, registration and authorization "
1395-
"fail until the scope is left out or made equal to the id."
1396-
msgstr ""
1397-
13981383
msgid "Attribute read to find the address a credential offer is sent to."
13991384
msgstr ""
14001385

‎locales/hr/LC_MESSAGES/oidc.po‎

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1421,27 +1421,12 @@ msgid ""
14211421
"default attribute above. Such entries are not listed here."
14221422
msgstr ""
14231423

1424-
msgid ""
1425-
"At least one credential configuration is named after a standard OpenID "
1426-
"Connect scope (openid, offline_access, profile, email, address, phone). "
1427-
"Such a name is refused, and with it the whole scope list, so discovery, "
1428-
"registration and authorization fail until it is renamed."
1429-
msgstr ""
1430-
14311424
msgid ""
14321425
"At least one credential configuration has a missing or unsupported "
14331426
"format, so it cannot issue credentials at all. Supported formats are "
14341427
"jwt_vc_json, dc+sd-jwt and vc+sd-jwt."
14351428
msgstr ""
14361429

1437-
msgid ""
1438-
"At least one credential configuration states a scope other than its own "
1439-
"id. The id is the scope a credential is granted under, so the stated one "
1440-
"would be advertised and then refused. Such a configuration is refused, and "
1441-
"with it the whole scope list, so discovery, registration and authorization "
1442-
"fail until the scope is left out or made equal to the id."
1443-
msgstr ""
1444-
14451430
msgid "Attribute read to find the address a credential offer is sent to."
14461431
msgstr ""
14471432

‎locales/it/LC_MESSAGES/oidc.po‎

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1374,27 +1374,12 @@ msgid ""
13741374
"default attribute above. Such entries are not listed here."
13751375
msgstr ""
13761376

1377-
msgid ""
1378-
"At least one credential configuration is named after a standard OpenID "
1379-
"Connect scope (openid, offline_access, profile, email, address, phone). "
1380-
"Such a name is refused, and with it the whole scope list, so discovery, "
1381-
"registration and authorization fail until it is renamed."
1382-
msgstr ""
1383-
13841377
msgid ""
13851378
"At least one credential configuration has a missing or unsupported "
13861379
"format, so it cannot issue credentials at all. Supported formats are "
13871380
"jwt_vc_json, dc+sd-jwt and vc+sd-jwt."
13881381
msgstr ""
13891382

1390-
msgid ""
1391-
"At least one credential configuration states a scope other than its own "
1392-
"id. The id is the scope a credential is granted under, so the stated one "
1393-
"would be advertised and then refused. Such a configuration is refused, and "
1394-
"with it the whole scope list, so discovery, registration and authorization "
1395-
"fail until the scope is left out or made equal to the id."
1396-
msgstr ""
1397-
13981383
msgid "Attribute read to find the address a credential offer is sent to."
13991384
msgstr ""
14001385

‎locales/nl/LC_MESSAGES/oidc.po‎

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1328,27 +1328,12 @@ msgid ""
13281328
"default attribute above. Such entries are not listed here."
13291329
msgstr ""
13301330

1331-
msgid ""
1332-
"At least one credential configuration is named after a standard OpenID "
1333-
"Connect scope (openid, offline_access, profile, email, address, phone). "
1334-
"Such a name is refused, and with it the whole scope list, so discovery, "
1335-
"registration and authorization fail until it is renamed."
1336-
msgstr ""
1337-
13381331
msgid ""
13391332
"At least one credential configuration has a missing or unsupported "
13401333
"format, so it cannot issue credentials at all. Supported formats are "
13411334
"jwt_vc_json, dc+sd-jwt and vc+sd-jwt."
13421335
msgstr ""
13431336

1344-
msgid ""
1345-
"At least one credential configuration states a scope other than its own "
1346-
"id. The id is the scope a credential is granted under, so the stated one "
1347-
"would be advertised and then refused. Such a configuration is refused, and "
1348-
"with it the whole scope list, so discovery, registration and authorization "
1349-
"fail until the scope is left out or made equal to the id."
1350-
msgstr ""
1351-
13521337
msgid "Attribute read to find the address a credential offer is sent to."
13531338
msgstr ""
13541339

0 commit comments

Comments
 (0)