Verify QR Code
Verify process starts from the user scanning a QR code that is specific to your application. This section explains the different types of QR codes supported, the URL formats, as well as how they can be generated.
1. Choosing type of QR code
Verify supports 2 types of QR code: "static" and "dynamic".
1.1 Static QR
Static QR codes are normally used for time-bound/one-off events. They can be printed on paper and distributed, and scanned multiple times. Being static in nature, the QR codes will not work after the stipulated validity.
1.2 Dynamic QR
Dynamic QR codes are normally used on digital devices such as tablet or kiosk. The QR codes should not be printed out, and should be displayed on the digital devices. Characteristics of dynamic QR codes are:
generated on the fly
short-lived e.g. valid for only 5 minutes after generation
one-time used i.e. invalidated once scanned.
You can choose to generate either QR codes depending on your application needs.
2. Generate Verify QR Code
2.1 URL format
The following is the format of the URL that will be used to produce Verify Dynamic QR code:
The URL contains parameters that denotes the type of QR, validity, application ID etc, summarised in the table below. Ensure that the parameters are given in the sequence shown below:
callback
required
string Example: "https%3A%2F%2Ftest.yourcallbackurl%2Fcallback" Your application's registered callback URL (URL encoded) for Verify to return authorisation code to.
client_id
required
string Example: "STG2-SGVERIFY-SELF-TEST" Unique ID for your application.
nonce
string Example: 4110833 Unique-random text to prevent replay attack. Note: Mandatory only if qr_type is dynamic
qr_type
required
string Enum: "static" "dynamic" Type of QR
signature_method
required
string Default: "RS256" Signature algorithm used to produce the digital signature.
state
required
string Example: "kiosk001" Identifier that represents the user's session/transaction with the client for reconciling query and response. The same value will be sent back via the callback URL. Use a unique system generated number for each user/transaction.
timestamp_expiry
required
string Example: "1602324610000" QR code expiry timestamp (UNIX epoch time in milliseconds)
timestamp_start
required
string Example: "1570702210000" QR code start timestamp (UNIX epoch time in milliseconds)
v
required
string Default: 2 Version of Verify API.
signature
required
string Example: "MEyCBY/XSBBB..." Binary of the generated signature encoded in Base64 URL-safe format. This digital signature will be used to ensure non-repudiation of the request.
2.2 Construct URL
The process of constructing the URL consists of three steps:
Step 1: Form the Verify URL with the query parameters
Form the base URL, excluding the digital signature.
Step 2: Sign the Verify URL on Step(1) with your private key
Digitally sign the URL constructed in Step 1 using your application's private key with cryptographic algorithm e.g. "RSA-SHA256".
Step 3: Add the signature into the URL
Append the digital signature as a parameter to the URL constructed in Step 1.
The final URL will look like the one above, echoed below:
2.3 Generate QR Code
Once you have the URL, you can use online tools to generate static QR codes, for example:
For dynamic QR codes, you will need to use platform specific libraries to generate the QR code image on the fly.
3. Displaying Verify QR code
Please ensure that the QR codes generated is in-line with our display guideline.
Last updated
Was this helpful?