@dfinity/verifiable-credentials SDK

Hi, I’m trying to test my VC issuer using @dfinity/verifiable-credentials on frontend, however the SDK does not seem to sends request on localhost, instead it’s sending the request to the ICP mainnet.

This is my how my requestVerifiablePresentation is constructed:

    requestVerifiablePresentation({
      onSuccess: async (verifiablePresentation: VerifiablePresentationResponse) => {
        console.log({ verifiablePresentation });
      },
      onError() {
        console.log("An error occurred");
      },
      issuerData: {
        origin: "http://bkyz2-fmaaa-aaaaa-qaaaq-cai.localhost:4943",
        canisterId: Principal.fromText("bkyz2-fmaaa-aaaaa-qaaaq-cai"),
      },
      credentialData: {
        credentialSpec: {
          credentialType: `Verified ${name} completion`,
          arguments: {
            issuedOn,
            issuerName,
            linkToWork,
            recipientName,
            name,
          },
        },
        credentialSubject: Principal.fromText(principal),
      },
      identityProvider: new URL(IDENTITY_PROVIDER),
    });

Just for posterity: The problem here was that an II instance on mainnet was being used in conjunction with an issuer on localhost.

If the issuer is on localhost, II needs to be too. Otherwise the two canisters would have different root keys anyways, which would not work.

3 Likes

Thanks @frederikrothenberger I runned II on localhost, now working

2 Likes