Sunbird RC QR code generation
Introduction
This document describes implementation of sunbird rc qr code generation based on the wiki.
https://project-sunbird.atlassian.net/browse/SB-29126
Problem Statement
To support the backward compatibility for qr code generation.
Prerequisite
Add the below data in /sunbird-rc-core/services/certificate-api/configs/keys.js
const qrType = process.env.QR_TYPE || 'W3C-VC';
const certDomainUrl = process.env.CERTIFICATE_DOMAIN_URL || "https://dev.sunbirded.org";
We are supporting 2 types of qr code.
W3C-VC (old)
URL-W3C-VC (new)
according to the formate what you need, change the process.env.QR_TYPE
variable;
change the signingKeyType
to KeyType.RSA
in /sunbird-rc-core/services/certificate-signer/configs/keys.js
const signingKeyType = process.env.SIGNING_KEY_TYPE || KeyType.RSA;
Solution
To make the Sunbird RC QR codes compatible with the existing version of Sunbird consumption app, the QR code generated by Sunbird RC should also be a URL. The proposed solution is to enable a provision in Sunbird RC to generate the QR code in URL format along with the W3C-VC data.
Request:
{{host}}/api/v1/TrainingCertificate/1-969a75a1-ac69-4a5b-a67b-092ddd4b29e2
Curl
Response:
We will get SVG file as a response.