diff --git a/services/src/main/java/org/keycloak/protocol/oid4vc/issuance/OID4VCIssuerEndpoint.java b/services/src/main/java/org/keycloak/protocol/oid4vc/issuance/OID4VCIssuerEndpoint.java index 82882cb815e..01dbd9cafb2 100644 --- a/services/src/main/java/org/keycloak/protocol/oid4vc/issuance/OID4VCIssuerEndpoint.java +++ b/services/src/main/java/org/keycloak/protocol/oid4vc/issuance/OID4VCIssuerEndpoint.java @@ -274,15 +274,6 @@ public class OID4VCIssuerEndpoint { LOGGER.debugf("Client '%s' is enabled for OID4VCI features.", client.getClientId()); } - /** - * Generates a unique notification ID for use in CredentialResponse. - * - * @return a unique string identifier - */ - private String generateNotificationId() { - return SecretGenerator.getInstance().randomString(); - } - /** * the OpenId4VCI nonce-endpoint * @@ -782,7 +773,6 @@ public class OID4VCIssuerEndpoint { // Generate credential response CredentialResponse responseVO = new CredentialResponse(); - responseVO.setNotificationId(generateNotificationId()); if (allProofs.isEmpty()) { // Single issuance without proof diff --git a/services/src/main/java/org/keycloak/protocol/oid4vc/model/CredentialIssuer.java b/services/src/main/java/org/keycloak/protocol/oid4vc/model/CredentialIssuer.java index c071f2123a1..59f22b5cb52 100644 --- a/services/src/main/java/org/keycloak/protocol/oid4vc/model/CredentialIssuer.java +++ b/services/src/main/java/org/keycloak/protocol/oid4vc/model/CredentialIssuer.java @@ -49,9 +49,6 @@ public class CredentialIssuer { @JsonProperty("authorization_servers") private List authorizationServers; - @JsonProperty("notification_endpoint") - private String notificationEndpoint; - @JsonProperty("batch_credential_issuance") private BatchCredentialIssuance batchCredentialIssuance; @@ -112,15 +109,6 @@ public class CredentialIssuer { return this; } - public String getNotificationEndpoint() { - return notificationEndpoint; - } - - public CredentialIssuer setNotificationEndpoint(String notificationEndpoint) { - this.notificationEndpoint = notificationEndpoint; - return this; - } - public BatchCredentialIssuance getBatchCredentialIssuance() { return batchCredentialIssuance; } diff --git a/services/src/main/java/org/keycloak/protocol/oid4vc/model/CredentialResponse.java b/services/src/main/java/org/keycloak/protocol/oid4vc/model/CredentialResponse.java index 60f8775943e..caebadcda86 100644 --- a/services/src/main/java/org/keycloak/protocol/oid4vc/model/CredentialResponse.java +++ b/services/src/main/java/org/keycloak/protocol/oid4vc/model/CredentialResponse.java @@ -38,9 +38,6 @@ public class CredentialResponse { @JsonProperty("transaction_id") private String transactionId; - @JsonProperty("notification_id") - private String notificationId; - public List getCredentials() { return credentials; } @@ -67,16 +64,6 @@ public class CredentialResponse { return this; } - public String getNotificationId() { - return notificationId; - } - - public CredentialResponse setNotificationId(String notificationId) { - this.notificationId = notificationId; - return this; - } - - /** * Inner class to represent a single credential object within the credentials array. */ diff --git a/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/oid4vc/issuance/signing/OID4VCJWTIssuerEndpointTest.java b/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/oid4vc/issuance/signing/OID4VCJWTIssuerEndpointTest.java index 41f19e6ac14..a154f0ff184 100644 --- a/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/oid4vc/issuance/signing/OID4VCJWTIssuerEndpointTest.java +++ b/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/oid4vc/issuance/signing/OID4VCJWTIssuerEndpointTest.java @@ -81,7 +81,6 @@ import static org.keycloak.OID4VCConstants.CREDENTIAL_SUBJECT; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertFalse; -import static org.junit.Assert.assertNotEquals; import static org.junit.Assert.assertNotNull; import static org.junit.Assert.assertNull; import static org.junit.Assert.assertTrue; @@ -595,40 +594,6 @@ public class OID4VCJWTIssuerEndpointTest extends OID4VCIssuerEndpointTest { testCredentialIssuanceWithAuthZCodeFlow(sdJwtTypeCredentialClientScope, getAccessToken, sendCredentialRequest); } - @Test - public void testRequestCredentialWithNotificationId() { - final String scopeName = jwtTypeCredentialClientScope.getName(); - String credConfigId = jwtTypeCredentialClientScope.getAttributes().get(CredentialScopeModel.CONFIGURATION_ID); - String token = getBearerToken(oauth, client, scopeName); - - testingClient.server(TEST_REALM_NAME).run((session) -> { - BearerTokenAuthenticator authenticator = new BearerTokenAuthenticator(session); - authenticator.setTokenString(token); - OID4VCIssuerEndpoint issuerEndpoint = prepareIssuerEndpoint(session, authenticator); - CredentialRequest credentialRequest = new CredentialRequest() - .setCredentialConfigurationId(credConfigId); - - String requestPayload = JsonSerialization.writeValueAsString(credentialRequest); - - // First credential request - Response response1 = issuerEndpoint.requestCredential(requestPayload); - assertEquals("The credential request should be successful.", HttpStatus.SC_OK, response1.getStatus()); - CredentialResponse credentialResponse1 = JsonSerialization.mapper.convertValue( - response1.getEntity(), CredentialResponse.class); - assertNotNull("Credential response should not be null", credentialResponse1); - assertNotNull("Credential should be present", credentialResponse1.getCredentials()); - assertNotNull("Notification ID should be present", credentialResponse1.getNotificationId()); - assertFalse("Notification ID should not be empty", credentialResponse1.getNotificationId().isEmpty()); - // Second credential request - Response response2 = issuerEndpoint.requestCredential(requestPayload); - assertEquals("The second credential request should be successful.", HttpStatus.SC_OK, response2.getStatus()); - CredentialResponse credentialResponse2 = JsonSerialization.mapper.convertValue( - response2.getEntity(), CredentialResponse.class); - assertNotEquals("Notification IDs should be unique", - credentialResponse1.getNotificationId(), credentialResponse2.getNotificationId()); - }); - } - /** * This is testing the multiple credential issuance flow in a single call with proofs */ @@ -696,10 +661,7 @@ public class OID4VCJWTIssuerEndpointTest extends OID4VCIssuerEndpointTest { "john@email.cz", vc.getCredentialSubject().getClaims().get("email")); assertFalse("Only supported mappers should be evaluated", vc.getCredentialSubject().getClaims().containsKey("AnotherCredentialType")); - } - - assertNotNull("Notification ID should be present", credentialResponse.getNotificationId()); } catch (Exception e) { throw new RuntimeException("Test failed due to: " + e.getMessage(), e); }