Sphereon-Opensource / SIOP-OID4VP

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

Verify issue with vp_token #69

Closed cindy-chin closed 5 months ago

cindy-chin commented 5 months ago

Hi, I have tried multiple vp_token from our company that following the current latest specification, but seems that is not able to verified by your library, that are many errors thrown. For example , 'Inconsistent issuance dates between JWT claim (${nbfDateAsStr}) and VC value (${issuanceDate})', and many other problem, May I have your one sample jwt_vp to investigate our ?

nklomp commented 5 months ago

That error suggests you really have a problem in your JWT VCs. See the section about JWT VC encoding and decoding in the Verifiable Credential Data model: https://www.w3.org/TR/vc-data-model/#jwt-decoding

Basically it boils down to W3C VCs in JSON-LD format have dates for things like issuanceDate and expirationDate. JWTs have similar concepts like iat, nbf etc. According to the above link the JWT claims should always be present. The issuanceDate and expirationDate are not mandatory to be present in the vc claim for JWT credentials.

However in your case the issuance and expiration values are present in both locations. So both as a JWT claim and in the vc object. But the values in there differ from eachother. Meaning we cannot know what the actual issuance or expiration date is, because you are giving conflicting values.

There should be example JWTs in the test cases for the library btw

nklomp commented 5 months ago

Below you have an end 2 end test, using an OpenBadge credential as JWT for instance against a live external system

https://github.com/Sphereon-Opensource/SIOP-OID4VP/blob/develop/test/e2e/mattr.launchpad.spec.ts