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.
108 stars 65 forks source link

The demo app's SDK usage does not match the SDK types #38

Closed kyegupov closed 3 years ago

kyegupov commented 3 years ago

For some reason the example app is written in plain JS, not TS. So, there's no type verification.

Looks like the type for RequestorBuilder constructor call https://github.com/Azure-Samples/active-directory-verifiable-credentials/blob/main/issuer/app.js#L86 does not match at all to the type in the SDK: https://github.com/microsoft/VerifiableCredentials-Verification-SDK-Typescript/blob/cadc9c787315662d561a32e7c83c22c2983f9f95/lib/api_oidc_request/RequestorBuilder.ts

When I've debugged the application and checked how the payload is populated https://github.com/microsoft/VerifiableCredentials-Verification-SDK-Typescript/blob/cadc9c787315662d561a32e7c83c22c2983f9f95/lib/api_oidc_request/Requestor.ts#L49 - sure enough, it was full of undefineds.

Even if the application works somehow, it's a terribly confusing example, since the code is obviously incorrect.

On top of that, even the field naming in that new RequestorBuilder call is very weird: schema.uri is set to credentialType (which is an array), but issuance[0].manifest is set to an URL. Something is definitely amiss here.

strumswell commented 3 years ago

@kyegupov Do you have a working example for TS? Would be very much appreciated.

kyegupov commented 3 years ago

@strumswell sorry, no. I could not figure out how to use it properly, and we decided not to use this technology on our project.