8000 [OID4VCI] Migrate CredentialsOffer to multiple grant types - Part2 by tdiesler · Pull Request #46947 · keycloak/keycloak · GitHub
[go: up one dir, main page]

Skip to content

[OID4VCI] Migrate CredentialsOffer to multiple grant types - Part2 - #46947

Merged
mposolda merged 1 commit into
keycloak:mainfrom
tdiesler:ghi46261-p2
Mar 9, 2026
Merged

mposolda merged 1 commit into
keycloak:mainfrom
tdiesler:ghi46261-p2

Conversation

@tdiesler
@tdiesler tdiesler commented Mar 6, 2026 •
Copy link
Copy Markdown
Contributor

closes #46976

related #46385

[OID4VCI] Add support for authorization_code grant - Part2

@tdiesler tdiesler changed the title [OID4VCI] Migrate CredentialsOffer to multiple grant types [OID4VCI] Migrate CredentialsOffer to multiple grant types - Part2 Mar 6, 2026
@tdiesler
tdiesler 10BC8 requested review from a team as code owners March 6, 2026 19:23
@tdiesler
tdiesler force-pushed the ghi46261-p2 branch 2 times, most recently from 72a4fa3 to 2157646 Compare March 9, 2026 08:19
@IngridPuppet IngridPuppet left a comment
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hello @tdiesler - I reviewed and approve of the changes in this PR. However, it'd help if you could clarify how you intend to use the now supported issuer state field.

Comment on lines +45 to 50
@JsonProperty(ISSUER_STATE)
private String issuerState;

public PreAuthorizedCode getPreAuthorizedCode() {
return preAuthorizedCode;
public String getIssuerState() {
return issuerState;
}
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As per my review, this is the main point of this PR. Could you clarify how this will be leveraged (in a subsequent PR?) and what are security concerns if the wallet sends back an unexpected value? My apologies if that's asking you to repeat yourself.

@tdiesler tdiesler Mar 9, 2026 •
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, this is part of PR #46950

Currently, the issuer state is simply the base64 encoded CredentialOfferState.Id

With so many "identifiers" floating around, it is perhaps useful to mention that this id is a server generated opaque id that identifies the internal CredentialOfferState. The offer state can now be retrieved using these three keys ...

  • CredentialOfferUri.Nonce (which is the id that the wallet uses to get the offer)
  • pre-authorized_code (which the token endpoint uses when a pre-auth code is redeemed)
  • CredentialOfferState.Id (which the authorization endpoint uses when given an issuer_state)

Also worth noting, that credential_identifier is no longer a key by which an offer state can be found. Instead it is (as intended by the spec) an identifier for a variation of claims that are available for a given credential_configuration_id. It is a property defined by the Issuer (i.e. vc.credential_identifier) on the client scope. It is no longer generated nor is it necessarily a UUID - I changed the test accordingly.

Currently, we only support a single value for this property - it should be multiple and there should be some mapping that results in different claims or claim values depending on credential_identifier

#46264

Copy link
Copy Markdown
Contributor
10BC8

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for the detailed context. It helps a lot to have CredentialOfferState.Id. I was even planning to add it for for JWT pre auth code PR I'm working on.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

UR welcome

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Currently, we only support a single value for this property - it should be multiple and there should be some mapping that results in different claims or claim values depending on credential_identifier
#46264

This can turn to be quite complicated, but depends on what exactly is in the scope for this "mapping support" . For me, the 1:1 mapping between credential_configuration_id and credential_identifier would be OK and it is sufficient to support just that for OID4VCI specification support as it is up to the Keycloak (Issuer) on what credential_identifiers it returns in the tokenResponse inside authorization_details . But support for "Authorization groups" of user profile would be likely OK . Added comment to the #46264 as I guess that is rather a place where to discuss the details of this?

Signed-off-by: Thomas Diesler <tdiesler@proton.me>
@mposolda mposolda left a comment
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@tdiesler @IngridPuppet Thanks for the PR and review! Added inline comment, but not a blocker for this PR (Added rather comment to #46264 for some clarification).

Comment on lines +45 to 50
@JsonProperty(ISSUER_STATE)
private String issuerState;

public PreAuthorizedCode getPreAuthorizedCode() {
return preAuthorizedCode;
public String getIssuerState() {
return issuerState;
}
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Currently, we only support a single value for this property - it should be multiple and there should be some mapping that results in different claims or claim values depending on credential_identifier
#46264

This can turn to be quite complicated, but depends on what exactly is in the scope for this "mapping support" . For me, the 1:1 mapping between credential_configuration_id and credential_identifier would be OK and it is sufficient to support just that for OID4VCI specification support as it is up to the Keycloak (Issuer) on what credential_identifiers it returns in the tokenResponse inside authorization_details . But support for "Authorization groups" of user profile would be likely OK . Added comment to the #46264 as I guess that is rather a place where to discuss the details of this?

@mposolda mposolda self-assigned this Mar 9, 2026
@mposolda
mposolda merged commit 46bcdb3 into keycloak:main Mar 9, 2026
84 checks passed
@tdiesler
tdiesler deleted the ghi46261-p2 branch March 9, 2026 11:00
@tdiesler
tdiesler commented Mar 9, 2026
Copy link
Copy Markdown
Contributor Author

merci

sashyo pushed a commit to tide-foundation/keycloak-IGA that referenced this pull request Jul 20, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Make CredentialsOffer to support multiple grant types

3 participants

0