Inji Verify local setup

Hi Team,

I’m trying to install and run Inji verify on my local setup. I have generated the verifiable credential using Inji Certify module but when generating QR code using pixelpass libarary I’m getting an error SyntaxError: Unexpected token 'export'.
Following is the code snippet I’m trying to run:

const pixelpass = require('@mosip/pixelpass');

const credential_data = <credential_json>
const qrCode = pixelpass.generateQRCode(JSON.parse(credential_data));

console.log(qrCode);

Hi @Aniket_Aditya

@swatigoel will come back to you on this sometime today.

Best Regards,
Team MOSIP

@Aniket_Aditya Please share the error you got after using 0.l.4 version of pixelpass with import statement.

@Aniket_Aditya current pixelpass library is supporting web and mobile application. We will be releasing an update today to support simple node js.
Once release is done, we will update here.

@Aniket_Aditya please update pixelpass to latest version 0.1.6, and check it

@swatigoel I was able to generate the qr code through example app but while verifying the qr in Inji verify I’m getting Unfortunately, the given credential is invalid! I’m running Inji verify from main branch.
Attaching the QR code for reference.

Do we need to do any configuration for verification sdk? How does inji verify verifies the legitimacy of the VC data? How does it verifies the issuer?

@Aniket_Aditya Right now, we only support web dids and we can see that the method in the vc is upai - did:upai:fb40941f-2b18-4a0b-bafa-35fc7b69e541

@ShivaKumar I have followed the demo-mosip-rc postman collection for creating DID and schemas. Can you please point me to the correct documentation related to DIDs and what exactly I need to follow for Inji Verify to work?

@Aniket_Aditya Please follow these steps:

  • Update WEB_DID_BASE_URL env in the docker compose file here and restart the services.
  • Please check regarding how web did works here.
  • We need to host the DIDs. For that, construct the the issuer did based on site where we are going to host the DID and pass this while generating the DID for the issuer.
  • And we need to make sure that the issuer did doc is available at this location after that and the same did will be passed while generating the VC as well
  • We generally hosted them in a github repository and then constructed the web did based on that while testing. Please try this once.

Please try these steps and let me know if there are any queries.

@ShivaKumar Could you please help me with the following queries :

  1. Update WEB_DID_BASE_URL env in the docker compose file here and restart the services - what should be passed as a value here? If we’re hosting it on github will it be github.com?
  2. We need to host the DIDs. For that, construct the the issuer did based on site where we are going to host the DID and pass this while generating the DID for the issuer. - is there any guide on how we are constructing the DID doc? I have found a sample DID doc here but not sure how are we creating this doc
  3. Following is the request body available in the demo-mosip-rc postman collection for generating the DID:
{
    "content": [
        {
            "alsoKnownAs": [
                "testUUID",
                "test@gmail.com"
            ],
            "services": [
                {
                    "id": "IdentityHub",
                    "type": "IdentityHub",
                    "serviceEndpoint": {
                        "@context": "schema.identity.foundation/hub",
                        "@type": "UserServiceEndpoint",
                        "instance": [
                            "did:test:hub.id"
                        ]
                    }
                }
            ],
            "method": "upai"
        }
    ]
}

can you please help with the updated request body for creating web based DID?

@Aniket_Aditya please check the examples provided here This link should give idea about how we construct the web dids from urls.
please update the method from upai to web in the payload to have a web did.

And regarding the configuration of WEB_DID_BASE_URL, let me give an example. Let’s say we are hosting the dids on github in repo named as webdids and xxxxx(will be a uuid) is the os id of the did doc returned in the response.

Now we need to create a folder with the os id and add a file called did.json with the issuer did document in it. Once we host them on Github pages, the url will look something like https://username.github.io/webdids/xxxxx/did.json. The issuer did for the same looks like: did:web:username.github.io:webdids:xxxxx. So, the WEB_DID_BASE_URL should look like https://username.github.io/webdids (replace username with the actual github handle of the account where the repo is created)

When we pass the method as web, the issuer did as shown above will automaticlly be generated in that format and the verify app will be able to resolve the issuer did.

Hi @ShivaKumar I followed the steps that you mentioned and generated the VC again using Inji Certify. but while verifying I’m still getting Invalid Credentials error. Attaching the QR for your reference

@Aniket_Aditya I see that the did document is hosted here.
I see that this is an array of a did document instead of just the did document. Please remove the array part and try again. The verification should work after that.

1 Like

@ShivaKumar Yes that helped and it is working fine now. Thanks!