eu-digital-identity-wallet / eudi-lib-ios-openid4vci-swift

Implementation of OpenID for Verifiable Credential Issuance protocol (wallet's role) in Swift
Apache License 2.0
4 stars 5 forks source link

Added decoding of credentials_supported key to parsing. (Else no supported_credentials are parsed) #27

Closed marcelsalej closed 2 months ago

marcelsalej commented 2 months ago

Description of change

When testing walletKit on main branches, I noticed that issuing a PID or MDL stopped working.

Tested with EUDI demo issuer: https://issuer.eudiw.dev/oidc

Issue was that wrong key was provided based on issuer response:

{
  "credential_endpoint": "https://issuer.eudiw.dev/oidc/credential",
  "credential_issuer": "https://issuer.eudiw.dev/oidc",
  "credentials_supported": {
    "eu.europa.ec.eudiw.mdl_jwt_vc_json": {
      "credential_definition": {
        "credentialSubject": {
          "administrative_number": {
            "display": [
              {
                "locale": "en",
                "name": "An audit control number assigned by the issuing authority"
              }
            ],
            "mandatory": false
          }

Now app tries to decode credential_configurations_supported first. If this fails it will try to decode also credentials_supported

Type of change

Please delete options that are not relevant.

How Has This Been Tested?

Please describe the tests that you ran to verify your changes. Provide instructions so we can reproduce. Please also list any relevant details for your test configuration

Checklist: