angusmillar / SmartHealthCard

Open-source .NET library for generating FHIR Smart Health Cards
HomePage
MIT License
24 stars 13 forks source link

VerifiableCredentialTypes (vc.type) Was Not An Allowed Value #9

Closed hiteshmehramca closed 2 years ago

hiteshmehramca commented 2 years ago

We are getting below mention issue in one scenario.

One of the VerifiableCredentialTypes (vc.type) was not an allowed value, type found was: VerifiableCredential.The supported types are: https://smarthealth.cards#covid19, https://smarthealth.cards#health-card, https://smarthealth.cards#immunization, https://smarthealth.cards#laboratory

Decoded Token has a non standard string highlighted below. Going by the specifications (https://spec.smarthealth.cards/vocabulary/) , this is not a valid type, so validation error thrown is correct. And we didn’t see such issue for any other Issuer.

type: [ "VerifiableCredential", "https://smarthealth.cards#health-card", "https://smarthealth.cards#immunization", "https://smarthealth.cards#covid19" ]

Below is the reason we got from Channel which passes us the Smart Health Card JWS some providers use: the root top level type “VerifiableCredential” for their cards, which is a default for verifiable credentials but is not used by SMART Health Cards anymore"

Can we please ignore additional types, the library is working very well for us for all scenarios except this one?

angusmillar commented 2 years ago

Hi @hiteshmehramca, I see the issue and they are correct in that the type of “VerifiableCredential” should be in the type list along with the others. I missed this because the SMART Health specification never mentions it. However, the underlying base specification from W3 for Verifiable Credentials does. So reading that spec I think the best cause of action is to allow the extra type of 'VerifiableCredentials' along with the other already allowed types, but nothing more.

I will try and get a new release going soon

angusmillar commented 2 years ago

Hi again @hiteshmehramca , I have now just published a new Nuget package release for the package '''SmartHealthCard.Token -Version 1.0.3''' which allows the use and validation of the type of 'VerifiableCredential'. Thanks for pointing this out and improving the libaray.

hiteshmehramca commented 2 years ago

Thanks @angusmillar , its working fine now. Thanks again for quick fix.