Azure-Samples / active-directory-verifiable-credentials

A code sample demonstrating how to use Azure Active Directory's preview functionality to issue and consume verifiable credentials.
107 stars 64 forks source link

VCNetworking.DecodingError #33

Closed mclasson closed 2 years ago

mclasson commented 3 years ago

When I try to validate a given credential (successfully stored in wallet) I can see in the backend that Authenticator calls presentation-request.jwt and gets the token. But then it says as below "DecodingError - unableToDecodeToken".

Where can I begin to troubleshoot this?

ERRO VerifiableCredential 0 TID=1 79 (fetchFromUrl(url:)) Error: Error: VCNetworking.DecodingError code: 0 Message: Failed to get the presentation request Properties: ["Line": "79", "Message": "Failed to get the presentation request", "Function": "fetchFromUrl(url:)", "CorrelationVector": "jvgvxzaoTiygyTOkIv/Sdw.0", "File": "/Users/runner/work/1/s/PhoneFactor/VerifiableCredentialWallet/VerifiableCredentialWallet/ViewModel/RequestProcessorViewModel.swift", "Error": "Error: VCNetworking.DecodingError code: 0"]
2021-05-18 11:40:35.320 INFO VerifiableCredential 0 TID=1 141 (stopTrackCurrentMeasuredEvent()) DIDPresentationRequest properties: ["HasFailed": "true", "CorrelationVector": "jvgvxzaoTiygyTOkIv/Sdw.0", "DIDFirstTimeOnBoarding": "false", "DIDSource": "QRScanner"]
2021-05-18 11:40:35.322 VERB VerifiableCredential 0 TID=1 266 (navigateUsing(navigationBlock:)) navigateUsing: view had not appeared CorrelationVector: jvgvxzaoTiygyTOkIv/Sdw.0
2021-05-18 11:40:35.449 VERB VerifiableCredential 0 TID=1 90 (configure()) Showing error page with unableToDecodeToken details:Error: VCNetworking.DecodingError code: 0 CorrelationVector: jvgvxzaoTiygyTOkIv/Sdw.0
backbone2k commented 3 years ago

I am getting the same error in the Authenticator App (iOS). I cannot not add the VC to my wallet.

mclasson commented 3 years ago

@backbone2k My error here was that I made credentialType an array twice. once in const credentialType = ['sdfsdf'];

and then again in

input_descriptors: [
        {
          id: "expert",
          schema: {
            uri: [credentialType],
          },
backbone2k commented 3 years ago

Hi @mclasson,

I have not changed the input_descriptors array. Only modified the credntialType const. I am not sure about the documentation when it comes to the Azure KeyVault. Have you made any changes to the didconfig.json at all ot the the variables: kvVaultUri, kvSigningId and kvRemoteSigningKeyId? The documentation explains to note down certain information from the newly created KeyVault but these are not used in the following parts....

I am really not getting what I did wrong :-(

mclasson commented 3 years ago

@backbone2k Yes, they are all my values. You get them from this page https://portal.azure.com/#blade/Microsoft_AAD_DecentralizedIdentity/InitialMenuBlade/issuerSettingsBlade copy the did and paste it here https://identity.foundation/ion/explorer/ to get the kvSigningKeyId. The azClientId and azClientSecret you got from where you did the AppRegistration

backbone2k commented 3 years ago

@mclasson Ah ok - but the azClientId and Secret are the second Tutorial / Part. I got stucked yesterday in the first example where you still use the MS B2C demo environment (https://docs.microsoft.com/en-us/azure/active-directory/verifiable-credentials/enable-your-tenant-verifiable-credentials) - But maybe I just toss this one and head over to the second part :-)

johncra commented 3 years ago

I have just published a blog which may help. https://www.xtseminars.co.uk/post/issuing-your-own-dids-vcs-with-azure-ad

From: cbag @.> Sent: 01 June 2021 12:42 To: Azure-Samples/active-directory-verifiable-credentials @.> Cc: Subscribed @.***> Subject: Re: [Azure-Samples/active-directory-verifiable-credentials] VCNetworking.DecodingError (#33)

@mclassonhttps://github.com/mclasson Ah ok - but the azClientId and Secret are the second Tutorial / Part. I got stucked yesterday in the first example where you still use the MS B2C demo environment (https://docs.microsoft.com/en-us/azure/active-directory/verifiable-credentials/enable-your-tenant-verifiable-credentials) - But maybe I just toss this one and head over to the second part :-)

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHubhttps://github.com/Azure-Samples/active-directory-verifiable-credentials/issues/33#issuecomment-852056545, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AGFPTB47KYSC4MIOFV724BLTQTBP7ANCNFSM45CMARVQ.

backbone2k commented 3 years ago

Hi @johncra,

thank you very much for your awesome resources on DID/VC. I started over from scratch, cloned the repo and made the modifications to the issuer app.js file - same issue. I think your information on "waiting" for the VC instance was the point I was missing. I think I was unpatient... Now it is working ;)

-- Christian

johncra commented 3 years ago

I am glad it’s working!

From: cbag @.> Sent: 07 June 2021 13:31 To: Azure-Samples/active-directory-verifiable-credentials @.> Cc: John Craddock (XTSeminars) @.>; Mention @.> Subject: Re: [Azure-Samples/active-directory-verifiable-credentials] VCNetworking.DecodingError (#33)

Hi @johncrahttps://github.com/johncra,

thank you very much for your awesome resources on DID/VC. I started over from scratch, cloned the repo and made the modifications to the issuer app.js file - same issue. I think your information on "waiting" for the VC instance was the point I was missing. I think I was unpatient... Now it is working ;)

-- Christian

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHubhttps://github.com/Azure-Samples/active-directory-verifiable-credentials/issues/33#issuecomment-855884636, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AGFPTB6NP22UWKCAE4RF4F3TRS3ZRANCNFSM45CMARVQ.

iBoonz commented 3 years ago

Thanks @mclasson , same mistake here :). You saved my alot of hours :)