feat: Add example for external VC issuer, Keycloak OID4VCI integration - #34
Open
bucchi wants to merge 1 commit into
Open
feat: Add example for external VC issuer, Keycloak OID4VCI integration#34bucchi wants to merge 1 commit into
bucchi wants to merge 1 commit into
Conversation
…ommit Signed-off-by: Yutaka Obuchi <yutaka.obuchi.sd@hitachi.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Related Issue
Fixes #33
Overview
To address the objective outlined in the related issue, this PR expands the provided examples to demonstrate how
verifiable-intentcan seamlessly integrate with a real-world, external Verifiable Credential issuer.In this example, I implemented the integration flow using Keycloak 26 (OID4VCI). It retrieves a real L1 SD-JWT and the issuer's public key (via JWKS), demonstrating a standard external issuance flow in real-world setups.
Key Changes
1. Example Expansion (
examples/autonomous_flow.py).well-known/openid-connect/certs(JWKS) endpoint for verification.2. Minor Core Tweaks (
src/verifiable_intent/verification/chain.py)To make the external integration work, I introduced two minor, backward-compatible tweaks:
l1_serializedis explicitly provided,verify_chainnow directly extracts the raw signing input and uses the existinges256_verifyutility. This prevents verification failures caused by JSON formatting differences (e.g., spacing/key order) between Java (Keycloak) and Python'sjson.dumps.dc+sd-jwtHeader Type: Updated the validation logic to acceptdc+sd-jwtas a valid JWTtypheader. This ensures compatibility with standard OID4VCI issuers like Keycloak that output Document Credentials.How to Test
1. Local Mock Mode (Default)
Simply run the example script as usual. It will generate the mock L1 and pass all verifications.
2. External Integration Mode (Keycloak OID4VCI)
To run the script with a real Keycloak 26 OID4VCI flow, set up your Keycloak realm, initiate a VC issuance, and export the following environment variables before running the example:
This will fetch the real L1 SD-JWT from Keycloak, resolve the issuer's key via JWKS, and verify the full 3-layer chain successfully.