8000 verifiable credential in account console by graziang · Pull Request #48940 · keycloak/keycloak · GitHub
[go: up one dir, main page]

Skip to content

verifiable credential in account console - #48940

Merged
mposolda merged 2 commits into
keycloak:mainfrom
graziang:issue-48576
May 13, 2026
Merged

mposolda merged 2 commits into
keycloak:mainfrom
graziang:issue-48576

Conversation

@graziang
@graziang graziang commented May 12, 2026 •
Copy link
Copy Markdown
Contributor

Closes #48576

  • Added new VIEW_VERIFIABLE_CREDENTIALS and MANAGE_VERIFIABLE_CREDENTIALS account client roles, created automatically for new realms, but not added as scope mapping to account console client. should we do it?
  • Created AccountVerifiableCredentialResource with get/delete endpoints for credentials with roles check
  • removed old broken Verifiable credentials view and related files and replaced with the new one
  • with the new view is possible to list the credentials and delete credentials with a confirmation modal (the delete button is only visible if the user has the manage role)
  • Added "Issue to Wallet" button to trigger AIA flow with verifiable_credential_offer action, used login with action parameter
  • Added tests to AccountRestServiceRolesTest

Screenshot:
Screenshot 2026-05-12 at 17 36 40

@graziang
graziang requested review from a team as code owners May 12, 2026 15:56
@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.

@graziang Thanks, nice! Added just few comments inline. Could you please check them?

// Construct the AIA action parameter
const config = {
credential_configuration_id: credential.credentialScopeName,
client_id: "account-console",
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.

Is it possible to remove this line and avoid using client_id as a parameter inside AIA? As in real scenario, this client would be a wallet, but "account-console" client does not represent OID4VCI wallet.

It is OK if credential-offer is not target for any specific client as we have other protections in place to make sure that just allowed clients are able to obtain the verifiable credential (as the client needs to have the "optional scope" available, which is target to the specific credential)

@Produces(MediaType.APPLICATION_JSON)
@NoCache
public Response getCredentials() {
auth.requireOneOf(AccountRoles.VIEW_VERIFIABLE_CREDENTIALS, AccountRoles.MANAGE_VERIFIABLE_CREDENTIALS);
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.

Suggested change
auth.requireOneOf(AccountRoles.VIEW_VERIFIABLE_CREDENTIALS, AccountRoles.MANAGE_VERIFIABLE_CREDENTIALS);
auth.requireOneOf(AccountRoles.MANAGE_ACCOUNT, AccountRoles.VIEW_VERIFIABLE_CREDENTIALS, AccountRoles.MANAGE_VERIFIABLE_CREDENTIALS);

Is it possible to include also MANAGE_ACCOUNT role here? That role is used in the account console in all other endpoints and user with this role is able to do anything in the account console.

This will also make sure that by default, account console "Verifiable credentials" work automatically for any user, which is aligned with other Keycloak "account" functionality.

I assume this may need some changes in the UI as well?

8000

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.

@mposolda I was thinking if it makes sense to not have the new roles at all and just use MANAGE_ACCOUNT for delete and VIEW_PROFILE for get. WDYT?

@mposolda mposolda May 13, 2026 •
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.

I think it is OK to have as you have in this PR right now. That is what was agreed for OID4VCI preview feature and is also aligned with some other account-console functionality (like consents or federated identities)

@DELETE
@Path("/{credentialScopeName}")
public Response revokeCredential(@PathParam("credentialScopeName") String credentialScopeName) {
auth.require(AccountRoles.MANAGE_VERIFIABLE_CREDENTIALS);
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.

Suggested change
auth.require(AccountRoles.MANAGE_VERIFIABLE_CREDENTIALS);
auth.require(AccountRoles.MANAGE_ACCOUNT, AccountRoles.MANAGE_VERIFIABLE_CREDENTIALS);

Same like the other comment above.

@mposolda mposolda self-assigned this May 12, 2026
@graziang
Copy link
Copy Markdown
Contributor Author

@graziang Thanks, nice! Added just few comments inline. Could you please check them?

@mposolda applied your suggestions, I was thinking if it makes sense to not have the new roles at all and just use MANAGE_ACCOUNT for delete and VIEW_PROFILE for get. It would be simpler to set up, but it wouldn't be possible to allow you to just remove the credentials and not do anything else on the account. So maybe it's okay to keep them.

@keycloak-github-bot
Copy link
Copy Markdown

Unreported flaky test detected

If the flaky tests below are affected by the changes, please review and update the changes accordingly. Otherwise, a maintainer should report the flaky tests prior to merging the PR.

org.keycloak.testsuite.adapter.servlet.SAMLServletAdapterTest#testSavedPostRequest

Keycloak CI - Adapter IT Strict Cookies

java.lang.AssertionError: 

Expected: a string ending with "secured/post"
     but: was "/auth/realms/demo/login-actions/authenticate"
	at org.hamcrest.MatcherAssert.assertThat(MatcherAssert.java:20)
...

Report flaky test

@keycloak-github-bot keycloak-github-bot Bot left a comment
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Unreported flaky test detected, please review

@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.

@graziang Thanks! Hope to merge once test failures are fixed (but I think they are unrelated as Javascript UI fails in other PRs as well... :-/ So maybe it might just need rebase once this is fixed in Keycloak main though...

@keycloak-github-bot
Copy link
Copy Markdown

Unreported flaky test detected

If the flaky tests below are affected by the changes, please review and update the changes accordingly. Otherwise, a maintainer should report the flaky tests prior to merging the PR.

org.keycloak.testsuite.adapter.servlet.SAMLServletAdapterTest#testSavedPostRequest

Keycloak CI - Adapter IT Strict Cookies

java.lang.AssertionError: 

Expected: a string ending with "secured/post"
     but: was "/auth/realms/demo/login-actions/authenticate"
	at org.hamcrest.MatcherAssert.assertThat(MatcherAssert.java:20)
...

Report flaky test

@keycloak-github-bot keycloak-github-bot Bot left a comment
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Unreported flaky test detected, please review

graziang added 2 commits May 13, 2026 12:58
< 8BD0 input type="hidden" name="id" value="C_kwDOKc8J1toAKDVhOGEwMDZmN2ZlMGRkODc3OTdmYTU0ZGNhMDI3YjMxNWMxNjE5NTg" data-targets="batch-deferred-content.inputs" autocomplete="off" />
Closes keycloak#48576

Signed-off-by: Giuseppe Graziano <g.graziano94@gmail.com>
Closes keycloak#48576

Signed-off-by: Giuseppe Graziano <g.graziano94@gmail.com>
@mposolda
mposolda merged commit 3f26004 into keycloak:main May 13, 2026
87 checks passed
@stianst stianst mentioned this pull request Jun 1, 2026
sashyo pushed a commit to tide-foundation/keycloak-IGA that referenced this pull request Jul 20, 2026
Closes keycloak#48576


Signed-off-by: Giuseppe Graziano <g.graziano94@gmail.com>
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.

[OID4VCI] Account console support for user credentials

2 participants

0