> For the complete documentation index, see [llms.txt](https://docs.emudhradigital.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.emudhradigital.com/documentation/esign-v2-online-aadhaar-ekyc/integration-models.md).

# Integration Models

eMudhra supports several ways to embed eSign v2 into an ASP journey. All of them use the same signed request/response XML defined in the [API Specification](broken://pages/4fc74eca2a8532cb73c8eaede82408639abac650); they differ in **where the user authenticates** and **how control passes between the ASP and eMudhra**.

| Model            | ASP channel | Authentication UI                               | Auth modes                                             | Best for                                   |
| ---------------- | ----------- | ----------------------------------------------- | ------------------------------------------------------ | ------------------------------------------ |
| Web (redirect)   | Web         | eMudhra web pages                               | OTP, T-OTP, fingerprint, iris (see matrix below)       | Portals, internet banking                  |
| Web-to-App       | Web         | eMudhra page + device app for capture           | Fingerprint, iris (Android); Face (Android, iOS)       | Web journeys that need biometric or face   |
| App-to-App       | Native app  | eMudhra app / gateway invoked by intent or link | OTP, T-OTP, Face; fingerprint and iris on Android only | Apps that prefer a hand-off over embedding |
| Embedded SDK     | Native app  | eMudhra SDK screens inside the ASP app          | OTP, T-OTP, Face; fingerprint and iris on Android only | Seamless in-app journeys                   |
| emSigner gateway | Web / API   | emSigner                                        | OTP, biometric                                         | Organisations not registered as ASP        |

### Support matrix by platform and authentication mode

| Platform                  | OTP              | T-OTP            | Fingerprint              | Iris                     | Face Auth        |
| ------------------------- | ---------------- | ---------------- | ------------------------ | ------------------------ | ---------------- |
| Web                       | ✅ Supported      | ✅ Supported      | ✅ Supported              | ✅ Supported              | ➖ Not applicable |
| Web – Android intent      | ➖ Not applicable | ➖ Not applicable | ✅ Supported              | ✅ Supported              | ✅ Supported      |
| Web – iOS intent          | ➖ Not applicable | ➖ Not applicable | ⛔ No support from vendor | ⛔ No support from vendor | ✅ Supported      |
| Android to Android intent | ✅ Supported      | ✅ Supported      | ✅ Supported              | ✅ Supported              | ✅ Supported      |
| iOS to iOS intent         | ✅ Supported      | ✅ Supported      | ⛔ No support from vendor | ⛔ No support from vendor | ✅ Supported      |
| Android SDK (.AAR)        | ✅ Supported      | ✅ Supported      | ✅ Supported              | ✅ Supported              | ✅ Supported      |
| iOS SDK (.framework)      | ✅ Supported      | ✅ Supported      | ⛔ No support from vendor | ⛔ No support from vendor | ✅ Supported      |

**Legend:** ✅ Supported — available in production. ➖ Not applicable — the mode is not used on that channel (for example, OTP and T-OTP are entered on the eMudhra web page, so they do not need an intent hand-off; face capture is not used in a desktop web flow). ⛔ No support from vendor — the biometric device vendors do not provide an iOS RD Service, so fingerprint and iris capture are not possible on iOS.

{% hint style="info" %}
For iOS users, use OTP, T-OTP or Face Auth. Fingerprint and iris are available on desktop web and on Android (intent, App-to-App and SDK).
{% endhint %}

## 1. Web (browser redirect)

```
User browser          ASP server                 eMudhra eSign gateway         UIDAI / CA
     │  Sign request ──►│                                 │                           │
     │                  │ hash doc, build & sign XML      │                           │
     │◄── auto-POST form (eSignRequest=XML) ─────────────►│ validate ASP & signature  │
     │            consent + Aadhaar + OTP/biometric ─────►│ ── auth / eKYC ──────────►│
     │                                                    │ ◄─ eKYC ─ key + DSC ──────│
     │◄── auto-POST to responseUrl (signed EsignResp) ────│ sign hash, destroy key    │
     │ ───────────────► │ verify ESP signature, embed     │                           │
```

* The ASP renders an auto-submitting HTML form that POSTs the signed request XML to the eMudhra gateway URL.
* eMudhra hosts the consent, Aadhaar entry and OTP/biometric pages.
* On completion, eMudhra POSTs the signed `EsignResp` to the ASP `responseUrl` (HTTPS).

## 2. Web-to-App

Used when a mobile-web journey needs a capture that only a device app can perform — fingerprint / iris via an Android RD Service, or Aadhaar Face on Android and iOS. OTP and T-OTP do not need an intent and are completed on the eMudhra web page.

**Variant A — same device (mobile browser):** the eMudhra page invokes the face-capture app or Android RD Service through an Android or iOS intent; after capture, the user is returned to the browser and the flow continues. On iOS only Face Auth is available through this route.

**Variant B — cross-device hand-off:** the signer starts on a desktop browser; eMudhra displays a QR code / deep link that opens the eMudhra eSign app on the signer's phone, where face or biometric capture is completed. The desktop session polls and continues automatically once the phone completes authentication. The response is still delivered to the ASP's `responseUrl`.

## 3. App-to-App

The ASP's native Android/iOS app hands the transaction to eMudhra and receives the result back:

1. ASP backend builds and signs the request XML (the ASP signing key must never be in the app).
2. The app launches the eMudhra eSign app or hosted gateway through an **Android intent / iOS universal link**, passing the request reference.
3. The user authenticates — OTP / T-OTP or Face Auth on Android and iOS; fingerprint / iris (RD Service) on Android only.
4. Control returns to the ASP app via a callback intent / URL scheme; the signed `EsignResp` is delivered to the ASP backend at `responseUrl`.

## 4. Embedded SDK

The **eMudhra eSign SDK** — Android (.AAR) and iOS (.framework) — embeds the full eSign experience in the ASP app:

* Renders consent, Aadhaar entry and OTP screens natively or in a secured WebView.
* Detects and invokes RD Services (Android) and face capture (Android and iOS), prompting installation where required.
* Handles session timeouts, cancellation and retries, and returns status codes to the app.
* Works with the ASP backend, which remains responsible for hashing and signing the request XML and for receiving/verifying the response.

**Typical SDK integration steps**

1. Add the SDK supplied by eMudhra (.AAR for Android, .framework for iOS).Add the SDK supplied by eMudhra (.AAR for Android, .framework for iOS).
2. Initialise with the environment (UAT/production) and ASP app identifier.
3. Fetch the signed request XML from your backend.
4. Call the SDK's start-signing method with the request XML and selected AuthMode.
5. Handle the success / failure / cancel callback; fetch the final result from your backend.

{% hint style="warning" %}
**Review before publishing:** SDK package names, method names, gateway URLs and the cross-device hand-off parameters should be confirmed with the eMudhra eSign product team and inserted here.
{% endhint %}

## Security considerations common to all models

* Hashing and XML signing happen on the **ASP server**, never in the browser or mobile app.
* `responseUrl` must be HTTPS and must validate the ESP signature before trusting the response.
* Do not log or persist Aadhaar numbers, OTPs or PID blocks in the ASP app.
* Use certificate pinning in mobile apps when calling the ASP backend and eMudhra endpoints.
