OpenID4VP - Send and Verify Credentials
Here are the steps to send and verify credentials using OpenID for Verifiable Presentation (OID4VP).
Step 1: Get the API Key
To get the API key contact support@igrant.io.
Step 2: Create Verification Request (Verfier/Relying Party)
Copy the code block below to create the verification request. Execute the API available here.
- JWT
- SD-JWT
{
"label": "Verify LPID",
"presentationDefinition": {
"id": "046acbac-ea8d-4f95-8b57-f58dd178132b",
"format": {
"jwt_vc": {
"alg": [
"ES256"
]
},
"jwt_vp": {
"alg": [
"ES256"
]
}
},
"input_descriptors": [
{
"id": "ef91319b-81a5-4f71-a602-de3eacccb543",
"constraints": {
"fields": [
{
"path": [
"$.type"
],
"filter": {
"type": "array",
"contains": {
"const": "VerifiableLegalPersonalIdentificationData"
}
}
}
]
}
}
]
}
}
{
"label": "Verify LPID",
"presentationDefinition": {
"id": "046acbac-ea8d-4f95-8b57-f58dd178132b",
"format": {
"vc+sd-jwt": {
"alg": [
"ES256"
]
},
"vp+sd-jwt": {
"alg": [
"ES256"
]
}
},
"input_descriptors": [
{
"id": "ef91319b-81a5-4f71-a602-de3eacccb543",
"constraints": {
"limit_disclosure": "required",
"fields": [
{
"path": [
"$.credentialSubject.identifier"
]
},
{
"path": [
"$.credentialSubject.legalName"
]
}
]
}
}
]
}
}
The presentation definition provided adheres to the specifications outlined in the DIF Presentation Exchange standard, as detailed here.
To reuse presentation definitions during verification, you can utilise the create presentation definition endpoint and use the presentationDefinitionId
during the verification request process.
Step 3: Receive Verification Request (Holder)
The holder wallet can receive the verification request in the following ways:
- Using your Data Wallet (or any other Digital Wallet: From the response, use the
vpTokenQrCode
and generate the QR code here using plain text option - Using your Organisation Wallet (or similar).
Step 4: Send and Receive Verifiable Presentation (Holder)
The holder wallet accepts (consents) to send the requested credentials.
Step 5: Send and Receive Verifiable Presentation (Verifier/Relying Party)
- The Verfier (Relying Party) receives the requested credentials and can verify it. They may read the received credential by executing the Read Verification History API.
- From the response received, the
vpTokenResponse
can be decoded using JWT.IO Decoder. - From decoded response, the
verifiableCredential
inside the 'vp' can be further decoded to view the received credentials.
Try It Yourself (With Demo Video)
Watch the below demo to learn verify credential API and try it out yourselves: