[OID4VCI] Remove deprecated constants used in the old testsuite (#46948)
Some checks failed
Weblate Sync / Trigger Weblate to pull the latest changes (push) Has been cancelled

closes #46984


Signed-off-by: Thomas Diesler <tdiesler@ibm.com>
This commit is contained in:
Thomas Diesler 2026-03-09 14:26:23 +01:00 committed by GitHub
parent fe50faec43
commit 18e1100d15
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
13 changed files with 70 additions and 83 deletions

View file

@ -136,19 +136,6 @@ public class CredentialScopeModel implements ClientScopeModel {
*/
public static final String VC_KEY_ATTESTATION_REQUIRED_USER_AUTH = "vc.key_attestations_required.user_authentication";
// [TODO] Remove deprecated constants used in the old testsuite
@Deprecated public static final String CONFIGURATION_ID = VC_CONFIGURATION_ID;
@Deprecated public static final String CREDENTIAL_IDENTIFIER = VC_IDENTIFIER;
@Deprecated public static final String CONTEXTS = VC_CONTEXTS;
@Deprecated public static final String EXPIRY_IN_SECONDS = VC_EXPIRY_IN_SECONDS;
@Deprecated public static final Integer EXPIRY_IN_SECONDS_DEFAULT = VC_EXPIRY_IN_SECONDS_DEFAULT;
@Deprecated public static final String FORMAT = VC_FORMAT;
@Deprecated public static final String ISSUER_DID = VC_ISSUER_DID;
@Deprecated public static final String KEY_ATTESTATION_REQUIRED = VC_KEY_ATTESTATION_REQUIRED;
@Deprecated public static final String KEY_ATTESTATION_REQUIRED_KEY_STORAGE = VC_KEY_ATTESTATION_REQUIRED_KEY_STORAGE;
@Deprecated public static final String KEY_ATTESTATION_REQUIRED_USER_AUTH = VC_KEY_ATTESTATION_REQUIRED_USER_AUTH;
@Deprecated public static final String TYPES = VC_SUPPORTED_TYPES;
/**
* the actual object that is represented by this scope
*/

View file

@ -142,7 +142,7 @@ public class OID4VCAttestationProofTest extends OID4VCIssuerEndpointTest {
@Test
public void testCredentialIssuanceWithAttestationProof() {
final String scopeName = jwtTypeCredentialClientScope.getName();
String configIdFromScope = jwtTypeCredentialClientScope.getAttributes().get(CredentialScopeModel.CONFIGURATION_ID);
String configIdFromScope = jwtTypeCredentialClientScope.getAttributes().get(CredentialScopeModel.VC_CONFIGURATION_ID);
final String credConfigId = configIdFromScope != null ? configIdFromScope : scopeName;
CredentialIssuer credentialIssuer = getCredentialIssuerMetadata();
OID4VCAuthorizationDetail authDetail = new OID4VCAuthorizationDetail();

View file

@ -194,7 +194,7 @@ public abstract class OID4VCAuthorizationCodeFlowTestBase extends OID4VCIssuerEn
// Perform authorization code flow to get authorization code (includes authorization_details)
AccessTokenResponse tokenResponse = authzCodeFlow(ctx);
String credentialConfigurationId = getCredentialClientScope().getAttributes().get(CredentialScopeModel.CONFIGURATION_ID);
String credentialConfigurationId = getCredentialClientScope().getAttributes().get(CredentialScopeModel.VC_CONFIGURATION_ID);
// Clear events before credential request
events.clear();
@ -293,7 +293,7 @@ public abstract class OID4VCAuthorizationCodeFlowTestBase extends OID4VCIssuerEn
// Perform authorization code flow to get authorization code
AccessTokenResponse tokenResponse = authzCodeFlow(ctx);
String credentialIdentifier = assertTokenResponse(tokenResponse);
String credentialConfigurationId = getCredentialClientScope().getAttributes().get(CredentialScopeModel.CONFIGURATION_ID);
String credentialConfigurationId = getCredentialClientScope().getAttributes().get(CredentialScopeModel.VC_CONFIGURATION_ID);
// Clear events before credential request
events.clear();
@ -351,7 +351,7 @@ public abstract class OID4VCAuthorizationCodeFlowTestBase extends OID4VCIssuerEn
// Request with mandatory lastName will fail as user does not have "lastName"
String credentialIdentifier = assertTokenResponse(tokenResponseWithMandatoryLastName);
String credentialConfigurationId = getCredentialClientScope().getAttributes().get(CredentialScopeModel.CONFIGURATION_ID);
String credentialConfigurationId = getCredentialClientScope().getAttributes().get(CredentialScopeModel.VC_CONFIGURATION_ID);
Oid4vcCredentialRequest credentialRequest = getCredentialRequest(ctx, credRequestSupplier, tokenResponseWithMandatoryLastName, credentialConfigurationId, credentialIdentifier);
Oid4vcCredentialResponse credentialResponse = credentialRequest.send();
@ -410,7 +410,7 @@ public abstract class OID4VCAuthorizationCodeFlowTestBase extends OID4VCIssuerEn
// Perform authorization code flow to get authorization code
AccessTokenResponse tokenResponse = authzCodeFlow(ctx);
String credentialIdentifier = assertTokenResponse(tokenResponse);
String credentialConfigurationId = getCredentialClientScope().getAttributes().get(CredentialScopeModel.CONFIGURATION_ID);
String credentialConfigurationId = getCredentialClientScope().getAttributes().get(CredentialScopeModel.VC_CONFIGURATION_ID);
// Clear events before credential request
events.clear();
@ -573,7 +573,7 @@ public abstract class OID4VCAuthorizationCodeFlowTestBase extends OID4VCIssuerEn
assertNotNull("authorization_details should be derived from requested OID4VC scope", authDetailsResponse);
assertFalse("authorization_details should not be empty", authDetailsResponse.isEmpty());
assertEquals("credential_configuration_id should match requested scope",
getCredentialClientScope().getAttributes().get(CredentialScopeModel.CONFIGURATION_ID),
getCredentialClientScope().getAttributes().get(CredentialScopeModel.VC_CONFIGURATION_ID),
authDetailsResponse.get(0).getCredentialConfigurationId());
assertNotNull("credential_identifiers should be present", authDetailsResponse.get(0).getCredentialIdentifiers());
assertFalse("credential_identifiers should not be empty", authDetailsResponse.get(0).getCredentialIdentifiers().isEmpty());
@ -927,7 +927,7 @@ public abstract class OID4VCAuthorizationCodeFlowTestBase extends OID4VCIssuerEn
// Perform authorization code flow to get authorization code
AccessTokenResponse tokenResponse = authzCodeFlow(ctx);
String credentialIdentifier = assertTokenResponse(tokenResponse);
String credentialConfigurationId = getCredentialClientScope().getAttributes().get(CredentialScopeModel.CONFIGURATION_ID);
String credentialConfigurationId = getCredentialClientScope().getAttributes().get(CredentialScopeModel.VC_CONFIGURATION_ID);
// Request the actual credential using the identifier
Oid4vcCredentialRequest credentialRequest = getCredentialRequest(ctx, credentialRequestSupplier, tokenResponse, credentialConfigurationId, credentialIdentifier);
@ -972,7 +972,7 @@ public abstract class OID4VCAuthorizationCodeFlowTestBase extends OID4VCIssuerEn
OID4VCAuthorizationDetail authDetail = new OID4VCAuthorizationDetail();
authDetail.setType(OPENID_CREDENTIAL);
authDetail.setCredentialConfigurationId(getCredentialClientScope().getAttributes().get(CredentialScopeModel.CONFIGURATION_ID));
authDetail.setCredentialConfigurationId(getCredentialClientScope().getAttributes().get(CredentialScopeModel.VC_CONFIGURATION_ID));
authDetail.setClaims(claimsForAuthorizationDetailsParameter);
authDetail.setLocations(Collections.singletonList(ctx.credentialIssuer.getCredentialIssuer()));
@ -1070,7 +1070,7 @@ public abstract class OID4VCAuthorizationCodeFlowTestBase extends OID4VCIssuerEn
authDetail.setType(OPENID_CREDENTIAL);
authDetail.setCredentialConfigurationId(credentialConfigurationId != null
? credentialConfigurationId
: getCredentialClientScope().getAttributes().get(CredentialScopeModel.CONFIGURATION_ID));
: getCredentialClientScope().getAttributes().get(CredentialScopeModel.VC_CONFIGURATION_ID));
authDetail.setLocations(Collections.singletonList(ctx.credentialIssuer.getCredentialIssuer()));
return authDetail;
}

View file

@ -106,7 +106,7 @@ public class OID4VCAuthorizationCodeFlowWithPARTest extends OID4VCIssuerEndpoint
Oid4vcTestContext ctx = prepareOid4vcTestContext();
// Step 1: Create PAR request with authorization_details
String credentialConfigurationId = getCredentialClientScope().getAttributes().get(CredentialScopeModel.CONFIGURATION_ID);
String credentialConfigurationId = getCredentialClientScope().getAttributes().get(CredentialScopeModel.VC_CONFIGURATION_ID);
// Create authorization details with claims
ClaimsDescription claim = new ClaimsDescription();
@ -290,7 +290,7 @@ public class OID4VCAuthorizationCodeFlowWithPARTest extends OID4VCIssuerEndpoint
assertFalse("authorization_details should not be empty", authDetailsResponse.isEmpty());
OID4VCAuthorizationDetail firstAuthorizationDetail = authDetailsResponse.get(0);
assertEquals("credential_configuration_id should match requested scope",
getCredentialClientScope().getAttributes().get(CredentialScopeModel.CONFIGURATION_ID),
getCredentialClientScope().getAttributes().get(CredentialScopeModel.VC_CONFIGURATION_ID),
firstAuthorizationDetail.getCredentialConfigurationId());
assertNotNull("credential_identifiers should be present", firstAuthorizationDetail.getCredentialIdentifiers());
assertFalse("credential_identifiers should not be empty", firstAuthorizationDetail.getCredentialIdentifiers().isEmpty());

View file

@ -117,7 +117,7 @@ public abstract class OID4VCAuthorizationDetailsFlowTestBase extends OID4VCIssue
protected Oid4vcTestContext prepareOid4vcTestContext(String token) throws Exception {
Oid4vcTestContext ctx = new Oid4vcTestContext();
String credentialConfigurationId = getCredentialClientScope().getAttributes().get(CredentialScopeModel.CONFIGURATION_ID);
String credentialConfigurationId = getCredentialClientScope().getAttributes().get(CredentialScopeModel.VC_CONFIGURATION_ID);
// Clear events before credential offer URI request
events.clear();
@ -182,7 +182,7 @@ public abstract class OID4VCAuthorizationDetailsFlowTestBase extends OID4VCIssue
// Get credential_configuration_id
ClientScopeRepresentation credClientScope = getCredentialClientScope();
String credConfigId = credClientScope.getAttributes().get(CredentialScopeModel.CONFIGURATION_ID);
String credConfigId = credClientScope.getAttributes().get(CredentialScopeModel.VC_CONFIGURATION_ID);
// Build authorization_details
OID4VCAuthorizationDetail authDetail = new OID4VCAuthorizationDetail();
@ -297,7 +297,7 @@ public abstract class OID4VCAuthorizationDetailsFlowTestBase extends OID4VCIssue
OID4VCAuthorizationDetail authDetail = new OID4VCAuthorizationDetail();
authDetail.setType(OPENID_CREDENTIAL);
authDetail.setCredentialConfigurationId(getCredentialClientScope().getAttributes().get(CredentialScopeModel.CONFIGURATION_ID));
authDetail.setCredentialConfigurationId(getCredentialClientScope().getAttributes().get(CredentialScopeModel.VC_CONFIGURATION_ID));
authDetail.setLocations(Collections.singletonList(ctx.credentialIssuer.getCredentialIssuer()));
List<OID4VCAuthorizationDetail> authDetails = List.of(authDetail);
@ -322,7 +322,7 @@ public abstract class OID4VCAuthorizationDetailsFlowTestBase extends OID4VCIssue
assertEquals(1, authDetailsResponse.size());
OID4VCAuthorizationDetail authDetailResponse = authDetailsResponse.get(0);
assertEquals(OPENID_CREDENTIAL, authDetailResponse.getType());
assertEquals(getCredentialClientScope().getAttributes().get(CredentialScopeModel.CONFIGURATION_ID), authDetailResponse.getCredentialConfigurationId());
assertEquals(getCredentialClientScope().getAttributes().get(CredentialScopeModel.VC_CONFIGURATION_ID), authDetailResponse.getCredentialConfigurationId());
assertNotNull(authDetailResponse.getCredentialIdentifiers());
assertEquals(1, authDetailResponse.getCredentialIdentifiers().size());
String firstIdentifier = authDetailResponse.getCredentialIdentifiers().get(0);
@ -357,7 +357,7 @@ public abstract class OID4VCAuthorizationDetailsFlowTestBase extends OID4VCIssue
OID4VCAuthorizationDetail authDetail = new OID4VCAuthorizationDetail();
authDetail.setType(OPENID_CREDENTIAL);
authDetail.setCredentialConfigurationId(getCredentialClientScope().getAttributes().get(CredentialScopeModel.CONFIGURATION_ID));
authDetail.setCredentialConfigurationId(getCredentialClientScope().getAttributes().get(CredentialScopeModel.VC_CONFIGURATION_ID));
authDetail.setClaims(Arrays.asList(claim));
authDetail.setLocations(Collections.singletonList(ctx.credentialIssuer.getCredentialIssuer()));
@ -375,7 +375,7 @@ public abstract class OID4VCAuthorizationDetailsFlowTestBase extends OID4VCIssue
assertEquals(1, authDetailsResponse.size());
OID4VCAuthorizationDetail authDetailResponse = authDetailsResponse.get(0);
assertEquals(OPENID_CREDENTIAL, authDetailResponse.getType());
assertEquals(getCredentialClientScope().getAttributes().get(CredentialScopeModel.CONFIGURATION_ID), authDetailResponse.getCredentialConfigurationId());
assertEquals(getCredentialClientScope().getAttributes().get(CredentialScopeModel.VC_CONFIGURATION_ID), authDetailResponse.getCredentialConfigurationId());
assertNotNull(authDetailResponse.getClaims());
assertEquals(1, authDetailResponse.getClaims().size());
ClaimsDescription responseClaim = authDetailResponse.getClaims().get(0);
@ -407,7 +407,7 @@ public abstract class OID4VCAuthorizationDetailsFlowTestBase extends OID4VCIssue
OID4VCAuthorizationDetail authDetail = new OID4VCAuthorizationDetail();
authDetail.setType(OPENID_CREDENTIAL);
authDetail.setCredentialConfigurationId(getCredentialClientScope().getAttributes().get(CredentialScopeModel.CONFIGURATION_ID));
authDetail.setCredentialConfigurationId(getCredentialClientScope().getAttributes().get(CredentialScopeModel.VC_CONFIGURATION_ID));
authDetail.setClaims(Arrays.asList(claim));
authDetail.setLocations(Collections.singletonList(ctx.credentialIssuer.getCredentialIssuer()));
@ -438,7 +438,7 @@ public abstract class OID4VCAuthorizationDetailsFlowTestBase extends OID4VCIssue
OID4VCAuthorizationDetail authDetail = new OID4VCAuthorizationDetail();
authDetail.setType(OPENID_CREDENTIAL);
authDetail.setCredentialConfigurationId(getCredentialClientScope().getAttributes().get(CredentialScopeModel.CONFIGURATION_ID));
authDetail.setCredentialConfigurationId(getCredentialClientScope().getAttributes().get(CredentialScopeModel.VC_CONFIGURATION_ID));
authDetail.setClaims(Arrays.asList(claim));
authDetail.setLocations(Collections.singletonList(ctx.credentialIssuer.getCredentialIssuer()));
@ -469,7 +469,7 @@ public abstract class OID4VCAuthorizationDetailsFlowTestBase extends OID4VCIssue
OID4VCAuthorizationDetail authDetail = new OID4VCAuthorizationDetail();
authDetail.setType(OPENID_CREDENTIAL);
authDetail.setCredentialConfigurationId(getCredentialClientScope().getAttributes().get(CredentialScopeModel.CONFIGURATION_ID));
authDetail.setCredentialConfigurationId(getCredentialClientScope().getAttributes().get(CredentialScopeModel.VC_CONFIGURATION_ID));
authDetail.setClaims(Arrays.asList(claim));
authDetail.setLocations(Collections.singletonList(ctx.credentialIssuer.getCredentialIssuer()));
@ -533,7 +533,7 @@ public abstract class OID4VCAuthorizationDetailsFlowTestBase extends OID4VCIssue
OID4VCAuthorizationDetail authDetail = new OID4VCAuthorizationDetail();
authDetail.setType(OPENID_CREDENTIAL);
authDetail.setCredentialConfigurationId(getCredentialClientScope().getAttributes().get(CredentialScopeModel.CONFIGURATION_ID));
authDetail.setCredentialConfigurationId(getCredentialClientScope().getAttributes().get(CredentialScopeModel.VC_CONFIGURATION_ID));
authDetail.setClaims(Arrays.asList(claim));
authDetail.setLocations(Collections.singletonList(ctx.credentialIssuer.getCredentialIssuer()));
@ -846,7 +846,7 @@ public abstract class OID4VCAuthorizationDetailsFlowTestBase extends OID4VCIssue
@Test
public void testCompleteFlowWithClaimsValidation() throws Exception {
String token = getBearerToken(oauth, client, getCredentialClientScope().getName());
String credConfigId = getCredentialClientScope().getAttributes().get(CredentialScopeModel.CONFIGURATION_ID);
String credConfigId = getCredentialClientScope().getAttributes().get(CredentialScopeModel.VC_CONFIGURATION_ID);
Oid4vcTestContext ctx = prepareOid4vcTestContext(token);
// Step 1: Request token with authorization details containing specific claims

View file

@ -81,7 +81,7 @@ public class OID4VCIssuerEndpointEncryptionTest extends OID4VCIssuerEndpointTest
@Test
public void testRequestCredentialWithEncryption() {
final String scopeName = jwtTypeCredentialClientScope.getName();
String credConfigId = jwtTypeCredentialClientScope.getAttributes().get(CredentialScopeModel.CONFIGURATION_ID);
String credConfigId = jwtTypeCredentialClientScope.getAttributes().get(CredentialScopeModel.VC_CONFIGURATION_ID);
CredentialIssuer credentialIssuer = getCredentialIssuerMetadata();
OID4VCAuthorizationDetail authDetail = new OID4VCAuthorizationDetail();
authDetail.setType(OPENID_CREDENTIAL);
@ -190,7 +190,7 @@ public class OID4VCIssuerEndpointEncryptionTest extends OID4VCIssuerEndpointTest
@Test
public void testEncryptedCredentialRequest() {
final String scopeName = jwtTypeCredentialClientScope.getName();
String credConfigId = jwtTypeCredentialClientScope.getAttributes().get(CredentialScopeModel.CONFIGURATION_ID);
String credConfigId = jwtTypeCredentialClientScope.getAttributes().get(CredentialScopeModel.VC_CONFIGURATION_ID);
CredentialIssuer credentialIssuer = getCredentialIssuerMetadata();
OID4VCAuthorizationDetail authDetail = new OID4VCAuthorizationDetail();
authDetail.setType(OPENID_CREDENTIAL);
@ -270,7 +270,7 @@ public class OID4VCIssuerEndpointEncryptionTest extends OID4VCIssuerEndpointTest
@Test
public void testEncryptedCredentialRequestWithCompression() {
final String scopeName = jwtTypeCredentialClientScope.getName();
String credConfigId = jwtTypeCredentialClientScope.getAttributes().get(CredentialScopeModel.CONFIGURATION_ID);
String credConfigId = jwtTypeCredentialClientScope.getAttributes().get(CredentialScopeModel.VC_CONFIGURATION_ID);
CredentialIssuer credentialIssuer = getCredentialIssuerMetadata();
OID4VCAuthorizationDetail authDetail = new OID4VCAuthorizationDetail();
authDetail.setType(OPENID_CREDENTIAL);
@ -389,7 +389,7 @@ public class OID4VCIssuerEndpointEncryptionTest extends OID4VCIssuerEndpointTest
public void testCredentialIssuanceWithEncryption() throws Exception {
// Integration test for the full credential issuance flow with encryption
String scopeName = jwtTypeCredentialClientScope.getName();
String credConfigId = jwtTypeCredentialClientScope.getAttributes().get(CredentialScopeModel.CONFIGURATION_ID);
String credConfigId = jwtTypeCredentialClientScope.getAttributes().get(CredentialScopeModel.VC_CONFIGURATION_ID);
CredentialIssuer credentialIssuer = getCredentialIssuerMetadata();
testCredentialIssuanceWithAuthZCodeFlow(jwtTypeCredentialClientScope,
@ -536,7 +536,7 @@ public class OID4VCIssuerEndpointEncryptionTest extends OID4VCIssuerEndpointTest
@Test
public void testRequestCredentialWithInvalidJWK() throws Throwable {
final String scopeName = jwtTypeCredentialClientScope.getName();
String credConfigId = jwtTypeCredentialClientScope.getAttributes().get(CredentialScopeModel.CONFIGURATION_ID);
String credConfigId = jwtTypeCredentialClientScope.getAttributes().get(CredentialScopeModel.VC_CONFIGURATION_ID);
CredentialIssuer credentialIssuer = getCredentialIssuerMetadata();
OID4VCAuthorizationDetail authDetail = new OID4VCAuthorizationDetail();
authDetail.setType(OPENID_CREDENTIAL);

View file

@ -341,16 +341,16 @@ public abstract class OID4VCIssuerEndpointTest extends OID4VCTest {
clientScope.setProtocol(OID4VCIConstants.OID4VC_PROTOCOL);
Map<String, String> attributes =
new HashMap<>(Map.of(ClientScopeModel.INCLUDE_IN_TOKEN_SCOPE, "true",
CredentialScopeModel.EXPIRY_IN_SECONDS, "15"));
CredentialScopeModel.VC_EXPIRY_IN_SECONDS, "15"));
BiConsumer<String, String> addAttribute = (attributeName, value) -> {
if (value != null) {
attributes.put(attributeName, value);
}
};
addAttribute.accept(CredentialScopeModel.ISSUER_DID, issuerDid);
addAttribute.accept(CredentialScopeModel.CONFIGURATION_ID, credentialConfigurationId);
addAttribute.accept(CredentialScopeModel.CREDENTIAL_IDENTIFIER, credentialIdentifier);
addAttribute.accept(CredentialScopeModel.FORMAT, format);
addAttribute.accept(CredentialScopeModel.VC_ISSUER_DID, issuerDid);
addAttribute.accept(CredentialScopeModel.VC_CONFIGURATION_ID, credentialConfigurationId);
addAttribute.accept(CredentialScopeModel.VC_IDENTIFIER, credentialIdentifier);
addAttribute.accept(CredentialScopeModel.VC_FORMAT, format);
addAttribute.accept(CredentialScopeModel.VCT, Optional.ofNullable(vct).orElse(credentialIdentifier));
if (credentialConfigurationId != null) {
String vcDisplay;
@ -365,11 +365,11 @@ public abstract class OID4VCIssuerEndpointTest extends OID4VCTest {
addAttribute.accept(CredentialScopeModel.VC_DISPLAY, vcDisplay);
}
if (acceptedKeyAttestationValues != null) {
attributes.put(CredentialScopeModel.KEY_ATTESTATION_REQUIRED, "true");
attributes.put(CredentialScopeModel.VC_KEY_ATTESTATION_REQUIRED, "true");
if (!acceptedKeyAttestationValues.isEmpty()) {
attributes.put(CredentialScopeModel.KEY_ATTESTATION_REQUIRED_KEY_STORAGE,
attributes.put(CredentialScopeModel.VC_KEY_ATTESTATION_REQUIRED_KEY_STORAGE,
String.join(",", acceptedKeyAttestationValues));
attributes.put(CredentialScopeModel.KEY_ATTESTATION_REQUIRED_USER_AUTH,
attributes.put(CredentialScopeModel.VC_KEY_ATTESTATION_REQUIRED_USER_AUTH,
String.join(",", acceptedKeyAttestationValues));
}
}
@ -558,8 +558,8 @@ public abstract class OID4VCIssuerEndpointTest extends OID4VCTest {
BiFunction<String, String, String> f,
Consumer<Map<String, Object>> c) {
String testScope = clientScope.getName();
String testFormat = clientScope.getAttributes().get(CredentialScopeModel.FORMAT);
String testCredentialConfigurationId = clientScope.getAttributes().get(CredentialScopeModel.CONFIGURATION_ID);
String testFormat = clientScope.getAttributes().get(CredentialScopeModel.VC_FORMAT);
String testCredentialConfigurationId = clientScope.getAttributes().get(CredentialScopeModel.VC_CONFIGURATION_ID);
try (Client client = AdminClientUtil.createResteasyClient()) {
String metadataUrl = getRealmMetadataPath(TEST_REALM_NAME);

View file

@ -527,7 +527,7 @@ public class OID4VCIssuerWellKnownProviderTest extends OID4VCIssuerEndpointTest
private void compareMetadataToClientScope(CredentialIssuer credentialIssuer, ClientScopeRepresentation clientScope) {
String credentialConfigurationId = Optional.ofNullable(clientScope.getAttributes()
.get(CredentialScopeModel.CONFIGURATION_ID))
.get(CredentialScopeModel.VC_CONFIGURATION_ID))
.orElse(clientScope.getName());
SupportedCredentialConfiguration supportedConfig = credentialIssuer.getCredentialsSupported()
.get(credentialConfigurationId);
@ -535,7 +535,7 @@ public class OID4VCIssuerWellKnownProviderTest extends OID4VCIssuerEndpointTest
supportedConfig);
assertEquals(credentialConfigurationId, supportedConfig.getId());
String expectedFormat = Optional.ofNullable(clientScope.getAttributes().get(CredentialScopeModel.FORMAT))
String expectedFormat = Optional.ofNullable(clientScope.getAttributes().get(CredentialScopeModel.VC_FORMAT))
.orElse(SD_JWT_VC);
assertEquals(expectedFormat, supportedConfig.getFormat());
@ -559,7 +559,7 @@ public class OID4VCIssuerWellKnownProviderTest extends OID4VCIssuerEndpointTest
assertNotNull(supportedConfig.getCredentialDefinition());
assertNotNull(supportedConfig.getCredentialDefinition().getType());
List<String> credentialDefinitionTypes = Optional.ofNullable(clientScope.getAttributes()
.get(CredentialScopeModel.TYPES))
.get(CredentialScopeModel.VC_SUPPORTED_TYPES))
.map(s -> s.split(","))
.map(Arrays::asList)
.orElseGet(() -> List.of(clientScope.getName()));
@ -569,7 +569,7 @@ public class OID4VCIssuerWellKnownProviderTest extends OID4VCIssuerEndpointTest
MatcherAssert.assertThat(supportedConfig.getCredentialDefinition().getContext(),
Matchers.containsInAnyOrder(credentialDefinitionTypes.toArray()));
List<String> credentialDefinitionContexts = Optional.ofNullable(clientScope.getAttributes()
.get(CredentialScopeModel.CONTEXTS))
.get(CredentialScopeModel.VC_CONTEXTS))
.map(s -> s.split(","))
.map(Arrays::asList)
.orElseGet(() -> List.of(clientScope.getName()));
@ -589,16 +589,16 @@ public class OID4VCIssuerWellKnownProviderTest extends OID4VCIssuerEndpointTest
List<String> expectedProofSigningAlgs = getAllAsymmetricAlgorithms();
KeyAttestationsRequired expectedKeyAttestationsRequired;
if (Boolean.parseBoolean(clientScope.getAttributes().get(CredentialScopeModel.KEY_ATTESTATION_REQUIRED))) {
if (Boolean.parseBoolean(clientScope.getAttributes().get(CredentialScopeModel.VC_KEY_ATTESTATION_REQUIRED))) {
expectedKeyAttestationsRequired = new KeyAttestationsRequired();
expectedKeyAttestationsRequired.setKeyStorage(
Optional.ofNullable(clientScope.getAttributes()
.get(CredentialScopeModel.KEY_ATTESTATION_REQUIRED_KEY_STORAGE))
.get(CredentialScopeModel.VC_KEY_ATTESTATION_REQUIRED_KEY_STORAGE))
.map(s -> Arrays.asList(s.split(",")))
.orElse(null));
expectedKeyAttestationsRequired.setUserAuthentication(
Optional.ofNullable(clientScope.getAttributes()
.get(CredentialScopeModel.KEY_ATTESTATION_REQUIRED_USER_AUTH))
.get(CredentialScopeModel.VC_KEY_ATTESTATION_REQUIRED_USER_AUTH))
.map(s -> Arrays.asList(s.split(",")))
.orElse(null));
} else {

View file

@ -141,7 +141,7 @@ public class OID4VCJWTIssuerEndpointTest extends OID4VCIssuerEndpointTest {
public void testGetCredentialOfferURI() {
final String scopeName = jwtTypeCredentialClientScope.getName();
final String credentialConfigurationId = jwtTypeCredentialClientScope.getAttributes()
.get(CredentialScopeModel.CONFIGURATION_ID);
.get(CredentialScopeModel.VC_CONFIGURATION_ID);
String token = getBearerToken(oauth, client, scopeName);
testingClient.server(TEST_REALM_NAME).run((session) -> {
@ -301,7 +301,7 @@ public class OID4VCJWTIssuerEndpointTest extends OID4VCIssuerEndpointTest {
@Test
public void testRequestCredentialNoMatchingCredentialBuilder() throws Throwable {
final String credentialConfigurationId = jwtTypeCredentialClientScope.getAttributes()
.get(CredentialScopeModel.CONFIGURATION_ID);
.get(CredentialScopeModel.VC_CONFIGURATION_ID);
final String scopeName = jwtTypeCredentialClientScope.getName();
CredentialIssuer credentialIssuer = getCredentialIssuerMetadata();
@ -361,7 +361,7 @@ public class OID4VCJWTIssuerEndpointTest extends OID4VCIssuerEndpointTest {
@Test
public void testRequestCredential() {
String scopeName = jwtTypeCredentialClientScope.getName();
String credConfigId = jwtTypeCredentialClientScope.getAttributes().get(CredentialScopeModel.CONFIGURATION_ID);
String credConfigId = jwtTypeCredentialClientScope.getAttributes().get(CredentialScopeModel.VC_CONFIGURATION_ID);
CredentialIssuer credentialIssuer = getCredentialIssuerMetadata();
OID4VCAuthorizationDetail authDetail = new OID4VCAuthorizationDetail();
authDetail.setType(OPENID_CREDENTIAL);
@ -447,7 +447,7 @@ public class OID4VCJWTIssuerEndpointTest extends OID4VCIssuerEndpointTest {
// 1. Retrieving the credential-offer-uri
final String credentialConfigurationId = jwtTypeCredentialClientScope.getAttributes()
.get(CredentialScopeModel.CONFIGURATION_ID);
.get(CredentialScopeModel.VC_CONFIGURATION_ID);
CredentialOfferURI credOfferUri = oauth.oid4vc()
.credentialOfferUriRequest(credentialConfigurationId)
.preAuthorized(true)
@ -522,7 +522,7 @@ public class OID4VCJWTIssuerEndpointTest extends OID4VCIssuerEndpointTest {
@Test
public void testCredentialIssuanceWithAuthZCodeWithScopeMatched() throws Exception {
String scopeName = jwtTypeCredentialClientScope.getName();
String credentialConfigurationId = jwtTypeCredentialClientScope.getAttributes().get(CredentialScopeModel.CONFIGURATION_ID);
String credentialConfigurationId = jwtTypeCredentialClientScope.getAttributes().get(CredentialScopeModel.VC_CONFIGURATION_ID);
CredentialIssuer credentialIssuer = getCredentialIssuerMetadata();
String authCode = getAuthorizationCode(oauth, client, "john", scopeName);
@ -625,7 +625,7 @@ public class OID4VCJWTIssuerEndpointTest extends OID4VCIssuerEndpointTest {
@Test
public void testRequestMultipleCredentialsWithProofs() {
final String scopeName = jwtTypeCredentialClientScope.getName();
String credConfigId = jwtTypeCredentialClientScope.getAttributes().get(CredentialScopeModel.CONFIGURATION_ID);
String credConfigId = jwtTypeCredentialClientScope.getAttributes().get(CredentialScopeModel.VC_CONFIGURATION_ID);
CredentialIssuer credentialIssuer = getCredentialIssuerMetadata();
OID4VCAuthorizationDetail authDetail = new OID4VCAuthorizationDetail();
@ -712,7 +712,7 @@ public class OID4VCJWTIssuerEndpointTest extends OID4VCIssuerEndpointTest {
public void testGetJwtVcConfigFromMetadata() {
final String scopeName = jwtTypeCredentialClientScope.getName();
final String credentialConfigurationId = jwtTypeCredentialClientScope.getAttributes()
.get(CredentialScopeModel.CONFIGURATION_ID);
.get(CredentialScopeModel.VC_CONFIGURATION_ID);
final String verifiableCredentialType = jwtTypeCredentialClientScope.getAttributes()
.get(CredentialScopeModel.VCT);
String expectedIssuer = suiteContext.getAuthServerInfo().getContextRoot().toString() + "/auth/realms/" + TEST_REALM_NAME;
@ -934,7 +934,7 @@ public class OID4VCJWTIssuerEndpointTest extends OID4VCIssuerEndpointTest {
@Test
public void testRequestCredentialWhenNoCredentialBuilderForFormat() {
String scopeName = jwtTypeCredentialClientScope.getName();
String credConfigId = jwtTypeCredentialClientScope.getAttributes().get(CredentialScopeModel.CONFIGURATION_ID);
String credConfigId = jwtTypeCredentialClientScope.getAttributes().get(CredentialScopeModel.VC_CONFIGURATION_ID);
CredentialIssuer credentialIssuer = getCredentialIssuerMetadata();
OID4VCAuthorizationDetail authDetail = new OID4VCAuthorizationDetail();
authDetail.setType(OPENID_CREDENTIAL);
@ -980,7 +980,7 @@ public class OID4VCJWTIssuerEndpointTest extends OID4VCIssuerEndpointTest {
public void testProofToProofsConversion() throws Exception {
final String scopeName = jwtTypeCredentialClientScope.getName();
final String credentialConfigurationId = jwtTypeCredentialClientScope.getAttributes()
.get(CredentialScopeModel.CONFIGURATION_ID);
.get(CredentialScopeModel.VC_CONFIGURATION_ID);
CredentialIssuer credentialIssuer = getCredentialIssuerMetadata();
OID4VCAuthorizationDetail authDetail = new OID4VCAuthorizationDetail();
@ -1066,7 +1066,7 @@ public class OID4VCJWTIssuerEndpointTest extends OID4VCIssuerEndpointTest {
// Extract serializable data before lambda
final String scopeName = optionalScope.getName();
final String configId = optionalScope.getAttributes().get(CredentialScopeModel.CONFIGURATION_ID);
final String configId = optionalScope.getAttributes().get(CredentialScopeModel.VC_CONFIGURATION_ID);
CredentialIssuer credentialIssuer = getCredentialIssuerMetadata();
OID4VCAuthorizationDetail authDetail = new OID4VCAuthorizationDetail();
@ -1198,7 +1198,7 @@ public class OID4VCJWTIssuerEndpointTest extends OID4VCIssuerEndpointTest {
public void testCredentialOfferReplayProtection() {
String token = getBearerToken(oauth, client, jwtTypeCredentialClientScope.getName());
final String credentialConfigurationId = jwtTypeCredentialClientScope.getAttributes()
.get(CredentialScopeModel.CONFIGURATION_ID);
.get(CredentialScopeModel.VC_CONFIGURATION_ID);
// 1. Retrieving the create-credential-offer
CredentialOfferURI credentialOfferURI = oauth.oid4vc()
@ -1246,7 +1246,7 @@ public class OID4VCJWTIssuerEndpointTest extends OID4VCIssuerEndpointTest {
public void testCredentialOfferDifferentNoncesIndependent() {
String token = getBearerToken(oauth, client, jwtTypeCredentialClientScope.getName());
final String credentialConfigurationId = jwtTypeCredentialClientScope.getAttributes()
.get(CredentialScopeModel.CONFIGURATION_ID);
.get(CredentialScopeModel.VC_CONFIGURATION_ID);
// 1. Create first credential offer
CredentialOfferURI credentialOfferURI1 = oauth.oid4vc()
@ -1323,7 +1323,7 @@ public class OID4VCJWTIssuerEndpointTest extends OID4VCIssuerEndpointTest {
public void testPreAuthorizedCodeValidAfterOfferConsumed() {
String token = getBearerToken(oauth, client, jwtTypeCredentialClientScope.getName());
final String credentialConfigurationId = jwtTypeCredentialClientScope.getAttributes()
.get(CredentialScopeModel.CONFIGURATION_ID);
.get(CredentialScopeModel.VC_CONFIGURATION_ID);
// 1. Fetch the Offer URI
CredentialOfferURI credentialOfferURI = oauth.oid4vc()

View file

@ -92,7 +92,7 @@ public class OID4VCSdJwtIssuingEndpointTest extends OID4VCIssuerEndpointTest {
@Test
public void testRequestTestCredential() {
String scopeName = sdJwtTypeCredentialClientScope.getName();
String credConfigId = sdJwtTypeCredentialClientScope.getAttributes().get(CredentialScopeModel.CONFIGURATION_ID);
String credConfigId = sdJwtTypeCredentialClientScope.getAttributes().get(CredentialScopeModel.VC_CONFIGURATION_ID);
CredentialIssuer credentialIssuer = getCredentialIssuerMetadata();
OID4VCAuthorizationDetail authDetail = new OID4VCAuthorizationDetail();
authDetail.setType(OPENID_CREDENTIAL);
@ -120,7 +120,7 @@ public class OID4VCSdJwtIssuingEndpointTest extends OID4VCIssuerEndpointTest {
public void testRequestTestCredentialWithKeybinding() {
String cNonce = getCNonce();
String scopeName = sdJwtTypeCredentialClientScope.getName();
String credConfigId = sdJwtTypeCredentialClientScope.getAttributes().get(CredentialScopeModel.CONFIGURATION_ID);
String credConfigId = sdJwtTypeCredentialClientScope.getAttributes().get(CredentialScopeModel.VC_CONFIGURATION_ID);
CredentialIssuer credentialIssuer = getCredentialIssuerMetadata();
OID4VCAuthorizationDetail authDetail = new OID4VCAuthorizationDetail();
authDetail.setType(OPENID_CREDENTIAL);
@ -153,7 +153,7 @@ public class OID4VCSdJwtIssuingEndpointTest extends OID4VCIssuerEndpointTest {
public void testRequestTestCredentialWithInvalidKeybinding() throws Throwable {
String cNonce = getCNonce();
String scopeName = sdJwtTypeCredentialClientScope.getName();
String credConfigId = sdJwtTypeCredentialClientScope.getAttributes().get(CredentialScopeModel.CONFIGURATION_ID);
String credConfigId = sdJwtTypeCredentialClientScope.getAttributes().get(CredentialScopeModel.VC_CONFIGURATION_ID);
CredentialIssuer credentialIssuer = getCredentialIssuerMetadata();
OID4VCAuthorizationDetail authDetail = new OID4VCAuthorizationDetail();
authDetail.setType(OPENID_CREDENTIAL);
@ -190,7 +190,7 @@ public class OID4VCSdJwtIssuingEndpointTest extends OID4VCIssuerEndpointTest {
public void testProofOfPossessionWithMissingAudience() throws Throwable {
try {
String scopeName = sdJwtTypeCredentialClientScope.getName();
String credConfigId = sdJwtTypeCredentialClientScope.getAttributes().get(CredentialScopeModel.CONFIGURATION_ID);
String credConfigId = sdJwtTypeCredentialClientScope.getAttributes().get(CredentialScopeModel.VC_CONFIGURATION_ID);
CredentialIssuer credentialIssuer = getCredentialIssuerMetadata();
OID4VCAuthorizationDetail authDetail = new OID4VCAuthorizationDetail();
authDetail.setType(OPENID_CREDENTIAL);
@ -235,7 +235,7 @@ public class OID4VCSdJwtIssuingEndpointTest extends OID4VCIssuerEndpointTest {
public void testProofOfPossessionWithIllegalSourceEndpoint() throws Throwable {
try {
String scopeName = sdJwtTypeCredentialClientScope.getName();
String credConfigId = sdJwtTypeCredentialClientScope.getAttributes().get(CredentialScopeModel.CONFIGURATION_ID);
String credConfigId = sdJwtTypeCredentialClientScope.getAttributes().get(CredentialScopeModel.VC_CONFIGURATION_ID);
CredentialIssuer credentialIssuer = getCredentialIssuerMetadata();
OID4VCAuthorizationDetail authDetail = new OID4VCAuthorizationDetail();
authDetail.setType(OPENID_CREDENTIAL);
@ -279,7 +279,7 @@ public class OID4VCSdJwtIssuingEndpointTest extends OID4VCIssuerEndpointTest {
public void testProofOfPossessionWithExpiredState() throws Throwable {
try {
String scopeName = sdJwtTypeCredentialClientScope.getName();
String credConfigId = sdJwtTypeCredentialClientScope.getAttributes().get(CredentialScopeModel.CONFIGURATION_ID);
String credConfigId = sdJwtTypeCredentialClientScope.getAttributes().get(CredentialScopeModel.VC_CONFIGURATION_ID);
CredentialIssuer credentialIssuer = getCredentialIssuerMetadata();
OID4VCAuthorizationDetail authDetail = new OID4VCAuthorizationDetail();
authDetail.setType(OPENID_CREDENTIAL);
@ -373,7 +373,7 @@ public class OID4VCSdJwtIssuingEndpointTest extends OID4VCIssuerEndpointTest {
String token = getBearerToken(oauth, client, clientScope.getName());
// 1. Retrieving the credential-offer-uri
final String credentialConfigurationId = clientScope.getAttributes().get(CredentialScopeModel.CONFIGURATION_ID);
final String credentialConfigurationId = clientScope.getAttributes().get(CredentialScopeModel.VC_CONFIGURATION_ID);
CredentialOfferURI credOfferUri = oauth.oid4vc()
.credentialOfferUriRequest(credentialConfigurationId)
.preAuthorized(true)
@ -454,7 +454,7 @@ public class OID4VCSdJwtIssuingEndpointTest extends OID4VCIssuerEndpointTest {
public void testGetSdJwtConfigFromMetadata() {
final String scopeName = sdJwtTypeCredentialClientScope.getName();
final String credentialConfigurationId = sdJwtTypeCredentialClientScope.getAttributes()
.get(CredentialScopeModel.CONFIGURATION_ID);
.get(CredentialScopeModel.VC_CONFIGURATION_ID);
final String verifiableCredentialType = sdJwtTypeCredentialClientScope.getAttributes()
.get(CredentialScopeModel.VCT);
String expectedIssuer = suiteContext.getAuthServerInfo().getContextRoot().toString() + "/auth/realms/" + TEST_REALM_NAME;
@ -625,7 +625,7 @@ public class OID4VCSdJwtIssuingEndpointTest extends OID4VCIssuerEndpointTest {
RealmModel realmModel = session.getContext().getRealm();
ClientScopeModel credentialScope = session.clientScopes()
.addClientScope(realmModel, jwtTypeCredentialScopeName);
credentialScope.setAttribute(CredentialScopeModel.CREDENTIAL_IDENTIFIER,
credentialScope.setAttribute(CredentialScopeModel.VC_IDENTIFIER,
jwtTypeCredentialScopeName);
credentialScope.setProtocol(OID4VCIConstants.OID4VC_PROTOCOL);
return credentialScope;

View file

@ -27,7 +27,7 @@ import org.keycloak.representations.idm.ClientScopeRepresentation;
import org.junit.Test;
import org.slf4j.LoggerFactory;
import static org.keycloak.models.oid4vci.CredentialScopeModel.CONFIGURATION_ID;
import static org.keycloak.models.oid4vci.CredentialScopeModel.VC_CONFIGURATION_ID;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertFalse;
@ -46,7 +46,7 @@ public class OID4VCSdJwtPreInstalledNaturalPersonTest extends OID4VCIssuerEndpoi
public void testGetSdJwtConfigFromMetadata() {
String scopeName = sdJwtTypeNaturalPersonScopeName;
ClientScopeRepresentation clientScope = requireExistingClientScope(scopeName);
String credentialConfigurationId = clientScope.getAttributes().get(CONFIGURATION_ID);
String credentialConfigurationId = clientScope.getAttributes().get(VC_CONFIGURATION_ID);
String expectedIssuer = suiteContext.getAuthServerInfo().getContextRoot() + "/auth/realms/" + TEST_REALM_NAME;
testingClient
.server(TEST_REALM_NAME)

View file

@ -65,7 +65,7 @@ public class OID4VCTimeNormalizationSdJwtTest extends OID4VCIssuerEndpointTest {
});
String scopeName = sdJwtTypeCredentialClientScope.getName();
String credConfigId = sdJwtTypeCredentialClientScope.getAttributes().get(CredentialScopeModel.CONFIGURATION_ID);
String credConfigId = sdJwtTypeCredentialClientScope.getAttributes().get(CredentialScopeModel.VC_CONFIGURATION_ID);
CredentialIssuer credentialIssuer = getCredentialIssuerMetadata();
OID4VCAuthorizationDetail authDetail = new OID4VCAuthorizationDetail();
authDetail.setType(OPENID_CREDENTIAL);

View file

@ -61,7 +61,7 @@ public class OID4VCTimeNormalizationTest extends OID4VCIssuerEndpointTest {
});
final String scopeName = jwtTypeCredentialClientScope.getName();
String credConfigId = jwtTypeCredentialClientScope.getAttributes().get(CredentialScopeModel.CONFIGURATION_ID);
String credConfigId = jwtTypeCredentialClientScope.getAttributes().get(CredentialScopeModel.VC_CONFIGURATION_ID);
CredentialIssuer credentialIssuer = getCredentialIssuerMetadata();
OID4VCAuthorizationDetail authDetail = new OID4VCAuthorizationDetail();
authDetail.setType(OPENID_CREDENTIAL);