Sphereon-Opensource / SIOP-OID4VP

Self Issued OpenID Provider v2 (SIOP) with optional OpenID for Verifiable Presentations (OpenID4VP)
77 stars 25 forks source link

Verifiable presentation with `jwt_vc` #52

Closed JensJelitto closed 1 year ago

JensJelitto commented 1 year ago

I want to respond to a verifier requesting credentials in jwt_vc format.

An example of a response can be found here: https://identity.foundation/jwt-vc-presentation-profile/#id-token-example

and should contain some descriptor_map with the following example content:

        "descriptor_map": [
          {
            "id": "InteropExampleVC",
            "format": "jwt_vp",
            "path": "$",
            "path_nested": {
              "id": "InteropExampleVC",
              "format": "jwt_vc",
              "path": "$.verifiableCredential[0]"
            }
          }
        ]

where the format is jwt_vc.

However, I haven't found a way to actually create such an id_token. When checking the repo I have found the following code with a hard-coded format: 'ldp_vc', see

https://github.com/Sphereon-Opensource/PEX/blob/45011a2bc49e70ea1aa761fa100181f924dca02b/lib/evaluation/handlers/uriEvaluationHandler.ts#L47

How can I achieve the creation of a properly formed id_token for jwt_vc credentials?

nklomp commented 1 year ago

Hi @JensJelitto This for sure needs to use the 0.3.0-unstable.25 version, which will be released as 0.3.0 this week. It has better support for JWTs, as the focus has been on LDP. I made some changes, based on on this ticket and now it takes the actual format from the internal uniform representation of a credential. Meaning that it detects the types and puts these in the descriptors.

So could you try 0.3.0-unstable.25 and see if that fixes it for you?

JensJelitto commented 1 year ago

Dear @nklomp : Thanks a lot for the prompt reply. I have tested the fixes and they indeed work for me, I now get a descriptor map like:

"descriptor_map": [
        {
          "id": "TestDigitalID",
          "format": "jwt_vc",
          "path": "$.verifiableCredential[0]"
        }
      ]

Appreciate your efforts!

nklomp commented 1 year ago

Cool, thanks for the feedback and nice words