Iframe Integration
The Identity User Session API lets you embed the complete Vlens verification and contracting UX inside your own application using an iframe or WebView — without exposing your ApiKey or admin credentials to the client.
Sessions are device-bound and user-bound. Each session is tied to a single device (via RSA public key) and expires after 30 minutes. A device is identified by its public key — store generated key pairs securely to avoid repeated mobile verification at each login.
How it works
- Your server calls Vlens with the user’s phone/email and session config
- The server passes
sessionStartingPathto the client app - The client loads the Vlens iframe at
<tenancy_name>-onboarding.vlenseg.com/<sessionStartingPath> - The user completes registration, KYC, and/or contract signing
- Your app receives completion events via
postMessage
Create Auth Session
A session that guides the user through whatever steps are needed based on their current state. Requires only ApiKey — no admin token.
Request fields
Response
sessionStartingPath is the path to append to your tenant’s base URL. If null, no session was created.
Create Invitation Session
A session with pre-filled data and an invitation notification (SMS or email) sent to the user. Requires admin bearer token + ApiKey.
Use this when you have already collected the customer’s information and want to minimize the steps they must complete.
smsProvider controls which SMS gateway sends the invitation. 0 = default from tenant settings.
Invitation links are short-lived (10 minutes) but the session itself lasts 30 minutes from when the user opens it. The link acts as a one-time OTP:
- Sent via SMS → no mobile verification required at login or registration
- Sent via email → no email verification required at registration
Loading the iframe
Concatenate sessionStartingPath to your tenant’s base URL:
The allow="camera; microphone" attribute is required for liveness detection to work in the browser.
postMessage integration
The iframe communicates with the parent app via window.postMessage. This is required for device-bound signing — the parent app holds the private key.
Iframe → Parent (signing request):
Parent → Iframe (signing response):
Key storage
The private key must never leave the device. Store it using each platform’s secure enclave:
Security features
Every session request includes three layers of protection:
Session permissions reference
Web app (no-code access)
Users can access the Vlens web app directly at:
No developer configuration is required. The web app manages keys and sessions securely — each browser is treated as a separate device with its own key pair.
To restrict access to invited users only, enable Invitation Only in the portal under Feature Control → Main Feature.
When to use each flow
Session API endpoints
Your server creates the session with CreateAuthSession or CreateInvitation. The embedded iframe then calls the endpoints below (you do not call these directly from your backend in most integrations).
For the native API equivalents (outside the iframe), see Digital Identity and E-Contracting. To associate a pre-login OCR transaction with a user after native login, see Link an existing transaction — that flow does not apply inside an iframe session.

