Aadhaar integration is woven into nearly every government digital service, and into most fintech onboarding flows too. This guide is for the developers and product teams building those flows. You will get the four integration patterns side by side, who is allowed to use each one, what the consent and security rules expect, and the pitfalls that live in the implementation details.
Aadhaar integration at a glance
Four main patterns: Authentication, eKYC, OKYC and Offline Aadhaar.
Each has specific use cases, regulatory requirements and user consent flows.
Direct API integrations route through UIDAI via licensed entities (KSAs and ASAs).
Privacy by design is mandated, and over-collection is illegal.
The four Aadhaar integration patterns
The patterns are clear once you know them. Here is how they compare before we look at each one.
Pattern | What you send | What you get back | KSA/ASA needed? | Typical use |
|---|---|---|---|---|
Authentication | Aadhaar number plus biometric or OTP | Yes or no | Yes | Subsidy distribution biometric check |
eKYC | Aadhaar number plus consent | Name, address, DOB, photo | Yes | Bank account opening |
OKYC | Nothing; the user brings their own KYC XML/PDF | A file whose digital signature you verify | No | Fintech and startup onboarding |
Offline Aadhaar | Nothing; the user decides what to share | What the user chose to share | No | User-controlled sharing |
Authentication (yes or no)
The user provides their Aadhaar number plus a biometric or an OTP. UIDAI returns yes or no for the assertion "this Aadhaar holder matches the provided biometric/OTP."
Use it for confirming identity without sharing personal information. Example: a biometric check during subsidy distribution.
eKYC
The user provides their Aadhaar number and their consent. UIDAI returns demographic data (name, address, date of birth and photo) to your application.
Use it for full KYC where you need proof of name and address. Example: bank account opening, subject to current RBI norms.
OKYC (Offline KYC)
The user downloads their own KYC XML or PDF from UIDAI directly and gives it to you. Your job is to verify the digital signature on it.
Use it for a simpler integration that does not require a KSA/ASA licence. It is the most common pattern for fintech onboarding now.
Offline Aadhaar
Similar to OKYC, but it emphasises the offline nature of the exchange: the user controls what is shared.
Who can use which pattern
Direct API access (Authentication and eKYC) requires being a KUA (KYC User Agency) and going through a KSA (KYC Service Agency) or an ASA (Authentication Service Agency). This path is licensed and regulated.
OKYC does not require a KSA or ASA. Most fintech and startup integrations use it for exactly that reason.
Designing the Aadhaar consent flow
UIDAI requires explicit, informed consent before any Aadhaar lookup. The consent must specify:
The purpose of the lookup
The data being requested
The recipient of the data
The retention policy
Log the consent. Show it to the user in their preferred language. Be auditable. In practice that means storing each of the four elements against the user and the moment they agreed, so you can answer later exactly what was shown and accepted. A consent record can be as simple as this:
create table aadhaar_consents (
id uuid primary key,
user_id uuid not null,
purpose text not null, -- why the lookup is made
data_scope text not null, -- what data is requested
recipient text not null, -- who receives the data
retention text not null, -- how long it is kept
language text not null, -- the language the user saw
consented_at timestamptz not null default now()
);
The same principles sit at the heart of India's data protection law, so it is worth reading this alongside our guide to the engineering controls the DPDP Act needs.
Security requirements for Aadhaar data
Requirement | What it means in your system |
|---|---|
Encrypt at rest | Aadhaar numbers must be encrypted wherever they are stored |
Mask on screen | Display only the last 4 digits in the UI; mask the rest |
Protect in transit | Transmit only over TLS |
Minimise retention | Keep data only for the minimum necessary period |
Restrict access | Control who can read it through IAM |
Masking is easiest to get right when there is one helper every screen uses, rather than each component slicing strings its own way:
// Show only the last 4 digits; never render the full number.
export function maskAadhaar(aadhaar: string): string {
const digits = aadhaar.replace(/\D/g, "");
if (digits.length < 4) return "XXXX XXXX XXXX";
return "XXXX XXXX " + digits.slice(-4);
}
Common Aadhaar integration pitfalls
Storing Aadhaar in plaintext. UIDAI rules prohibit it. Encrypt or tokenise.
Logging Aadhaar in app logs. The same prohibition applies, and logs are easy to forget because they are copied to so many places.
Over-collecting. Asking for Aadhaar when you do not need it. Justify every lookup.
Forgetting opt-out. Provide alternatives for users who do not want to use Aadhaar. A clear alternative path also helps completion rates; our piece on KYC drop-off optimisation covers how onboarding design affects abandonment.
What we recommend
For most fintech and startup use cases, OKYC is the right pattern: lower regulatory burden, and sufficient for KYC. Use eKYC or Authentication only if your use case truly needs it. If you are building a lending product, our walkthrough of a UPI-first lending app from KYC to disbursal shows where identity checks sit in the wider flow. For citizen-facing services, pair the integration with the guidance in building accessible government services.
Justify every lookup, mask every display, and log the consent, never the number.
FAQs
Can private companies use Aadhaar Authentication?
Yes, but they require specific permission (for example, banks and telcos).
What is the difference between OKYC and Video KYC?
They are different layers. OKYC verifies demographic data; Video KYC adds liveness. They are often used together.
Is m-Aadhaar a separate integration?
No. m-Aadhaar is a UIDAI app, and you do not integrate with it directly.
Planning a product that touches Aadhaar? See how we approach Aadhaar-aware engineering for complex web applications, or talk to Techpuvi about Aadhaar-aware engineering.
