From 6b8ed252d2de817e57294a93cf8fe3fd865beca6 Mon Sep 17 00:00:00 2001 From: Thomas Diesler Date: Thu, 2 Jul 2026 15:48:03 +0200 Subject: [PATCH 1/2] [OID4VCI] Issuance with Authorization Code Flow assumes same client_id for offer creation and redemption closes #48188 Signed-off-by: Thomas Diesler * Stop binding authorization-code credential offers to the creating client (targetClientId = null for auth-code offers). * Keep pre-authorized code offers bound to the authenticated client. * Update Javadoc section headings to explicitly name the corresponding grant types. --- .../oid4vc/issuance/OID4VCIssuerEndpoint.java | 10 ++- .../oid4vc/CredentialOfferStateUtils.java | 65 +++++++++++++++++++ .../OID4VCredentialOfferAuthCodeTest.java | 20 +++++- .../OID4VCredentialOfferPreAuthTest.java | 24 ++++++- 4 files changed, 112 insertions(+), 7 deletions(-) create mode 100644 tests/base/src/test/java/org/keycloak/tests/oid4vc/CredentialOfferStateUtils.java 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 f7ef9baf7f88..0377a7992f4c 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 @@ -429,7 +429,7 @@ public Response createCredentialOffer(String credConfigId, boolean preAuthorized * | yes | yes | yes | Offer restricted to a specific user. | * +----------+----------+---------+--------------------------------------------+ *

- * Pre-Authorized Offer + * Pre-Authorized Code Grant Offer * * - * Non Pre-Authorized Offer + * Authorization Code Grant Offer *