Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[OID4VCI] Approaching Credential Scope based API design #32961

Open
Tracked by #7
Captain-P-Goldfish opened this issue Sep 16, 2024 · 0 comments
Open
Tracked by #7

[OID4VCI] Approaching Credential Scope based API design #32961

Captain-P-Goldfish opened this issue Sep 16, 2024 · 0 comments
Labels
area/oid4vc Issue related to OpenID for Verifiable Credentials kind/epic status/triage team/core-clients

Comments

@Captain-P-Goldfish
Copy link
Contributor

Captain-P-Goldfish commented Sep 16, 2024

Description

Governikus reference implementation of scope-based credentials: https://gitlab.opencode.de/governikus/eudi-wallet-pid-provider-governikus-kg

Description

This issue is the idea of a bird-perspective for the code-design for building credentials for OpenID4VCI. It describes a simple code-snippet that should represent how the underlying API-interfaces can be designed in order to create a smooth reusable and adjustable API to build claims of arbitrary types.

UserModel userModel = getAuthenticatedUser(keycloakSession);
ClientScope clientScope = getClientScope(credentialRequest);
Map<String, Object> claims = getClaims(clientScope, userModel);
CredentialBuilder credentialBuilder = keycloakSession.getProvider(CredentialBuilder.class,
                                                                  credentialRequest.getFormat());
CredentialBody credentialBody = credentialBuilder.buildCredentialBody(claims);
CredentialSigner credentialSigner = keycloakSession.getProvider(CredentialSigner.class,
                                                                credentialRequest.getFormat());
String signedCredential = credentialSigner.sign(credentialBody, clientScope);

This is not a strict code example but it shall give an idea about how the approach could be used if it is ready.

Discussion

#32777

Issues

removed from the list of tasks

Motivation

No response

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/oid4vc Issue related to OpenID for Verifiable Credentials kind/epic status/triage team/core-clients
Projects
None yet
Development

No branches or pull requests

2 participants