Aadhaar Toolkit — Aadhaar Verification with RESTMessageV2 + Connection & Credential Alias #2166
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This contribution introduces SmartAadhaar Toolkit, a complete package for Aadhaar verification within ServiceNow.
It is not just a Script Include — it combines:
Script Include wrapper (SmartAadhaar) for OTP-based, demographic, document, and status verification
RESTMessageV2 integration for secure API calls
Connection & Credential Alias (aadhaar_api) for endpoint + credential management
Why this is useful
Aadhaar verification is a common need for organizations onboarding users in India. Instead of re-writing REST calls each time, this toolkit provides a drop-in, reusable utility that follows ServiceNow best practices:
🔒 Security: no hardcoded secrets, input validation, masking of Aadhaar numbers
⚡ Reliability: retry logic, exponential backoff, error handling
🧾 Compliance: session management, consent tracking hooks, audit logging
🛠️ Flexibility: endpoints configurable per provider, works with any UIDAI-approved gateway
Folder placement
Per the contributing guidelines, the snippet is placed under:
Server-Side Components/
REST Integrations/
Aadhaar Verification/
README.md
script.js
This location reflects that it is a REST integration toolkit (Script Include + RESTMessageV2 + Connection & Credential Alias) rather than a standalone Script Include.
How to test
Configure a Connection & Credential Alias: aadhaar_api with your provider’s base URL + credentials.
Run the sample Background Script calls from README.md:
sendOtp() → user receives OTP
verifyOtp() → returns eKYC data
verifyDemographic() → returns match score
getDocument() → fetches Aadhaar XML/PDF
checkStatus() → checks verification status
Security note
No Aadhaar number or OTP is logged (masked in logs).
No credentials are hardcoded (all stored in Connection & Credential Alias).
Explicit consent tracking supported via helper params.