QR Code Verification
📌 Overview
QR Code verification is a secure and user-friendly method to activate or authenticate a user without manually entering an OTP. The QR code typically contains an OTP and its associated verification key in JSON format.
📩 QR Code Delivery
- A QR code is sent to the user's email address as part of activation or OTP verification.
- This QR code contains an encrypted payload with the OTP details.
🧾 QR Code Format (Scanned Content)
Below is the format of code received in the user’s registered email id:

The scanned QR code contains the following JSON:
{
"value": "dtm88k",
"key": "jg9ksj",
"expiry": "2021-03-10T12:26:04IST",
"userId": "prit1"
}
🔍 Field Descriptions
Field | Description |
---|---|
value | The OTP or activation code value |
key | Verification key tied to this code, must match SDK's verificationKey |
expiry | Expiration time of this QR code |
userId | The user ID this QR code belongs to |
🔄 Workflow
- The SDK triggers a challenge like
getActivationCode
orgetEmailOTP
. - Your app displays a QR scanner UI to the user.
- User scans the QR code from email.
- The app extracts the
value
andkey
from the QR code JSON. - It compares the
key
withverificationKey
received from the SDK. - If they match, the app calls the corresponding API:
setActivationCode(value)
– for activation flowssetEmailOTP(value)
– for email-based OTP verification
🎯 Matching Keys
- Match
verificationKey
from SDK payload withkey
from QR JSON. - Only submit the
value
if the keys match.
⚠️ Error Scenarios
Error Code | Meaning |
---|---|
4 | Invalid arguments (malformed input) |
17 | Service not supported |
52 | Failed to open HTTP connection |
108 | Invalid TOTP credential |
Ensure QR code hasn’t expired and hasn’t been modified.
🧠 Best Practices
- Always check QR code
expiry
before using. - Provide fallback option to manually enter OTP.
- Validate that scanned
key
matches SDK-providedverificationKey
.
Updated 3 months ago