eu-digital-identity-wallet / eudi-lib-ios-siop-openid4vp-swift

Implementation of SIOPv2 and OpenID4VP protocols (wallet's role) in SWIFT
Apache License 2.0
4 stars 3 forks source link

client_id_scheme may fail whole VP token creation #72

Open vpilkevych-ddy opened 2 days ago

vpilkevych-ddy commented 2 days ago

Please take a look at one of the ValidatedSiopOpenId4VPRequest.createVpToken() functions.

https://github.com/eu-digital-identity-wallet/eudi-lib-ios-siop-openid4vp-swift/blob/main/Sources/Entities/Validated/ValidatedSiopOpenId4VPRequest.swift#L455

Because of the try keyword this fails in case if the scheme is absent. According to the specification client_id_scheme is optional.

https://openid.net/specs/openid-4-verifiable-presentations-1_0-18.html#section-5-8.6

If it's a deliberate design choice, maybe then the scheme validation doesn't have to be so strict here:

https://github.com/eu-digital-identity-wallet/eudi-lib-ios-siop-openid4vp-swift/blob/main/Sources/Entities/ClientMetaData/ClientIdScheme.swift#L41

For example, the DID scheme is in the enum, it is in the supported scheme enum, but still is not considered as valid, although the library doesn't need to do anything specific in such case, it is wallet's responsibility.

dtsiflit commented 2 days ago

Thank you very much for opening this issue @vpilkevych-ddy! I'll assign it to myself to resolve it.