For AI agents: a documentation index is available at the root level at /llms.txt and /llms-full.txt. Append /llms.txt to any URL for a page-level index, or .md for the markdown version of any page.
Dashboard
HomeAPI Reference
HomeAPI Reference
  • Get started
    • Welcome
    • Quick Start
  • API basics
    • Authentication
    • Conventions
    • Errors
    • Webhooks
  • Products
    • Digital Identity
    • OCR & Computer Vision
    • E-Contracting
    • OAuth Registration
    • Iframe Integration
  • SDKs
    • Flutter SDK
  • Resources
    • Support
  • Changelog
    • Changelog
Dashboard
LogoLogo
On this page
  • Setup
  • How it works
  • Step 1 — Verify the OAuth token
  • Step 2 — Complete registration
  • Skip email for an existing user
  • Supported providers
  • Standard registration comparison
Products

OAuth Registration

Register and authenticate users with Google or Microsoft accounts
||View as Markdown|
Was this page helpful?
Edit this page
Previous

E-Contracting

Next

Iframe Integration

Built with

Vlens supports OAuth 2.0 authentication via Google and Microsoft (Azure AD B2C). Users can register and log in using an existing social account — skipping the email OTP verification step.


Setup

OAuth providers must be configured in the Vlens portal before use:

  • Google — create OAuth client credentials in the Google Cloud Platform Console
  • Microsoft — set up credentials in Azure AD B2C

Contact your Vlens administrator to enable and link the client credentials to your tenant.


How it works


Step 1 — Verify the OAuth token

After your app obtains an ID token from the provider, send it to Vlens for verification:

cURL
JavaScript
Python
$curl -X POST https://api.vlenseg.com/api/DigitalIdentity/Register/StepVerifyOAuthToken \
> -H "ApiKey: YOUR_API_KEY" \
> -H "Content-Type: application/json" \
> -d '{
> "provider": "Google",
> "IdToken": "OAUTH_ID_TOKEN_FROM_PROVIDER"
> }'

Response:

1{
2 "data": {
3 "oAuthTokenVerificationRequestId": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
4 "isVerified": true,
5 "validationResult": "Token verified successfully",
6 "email": "user@gmail.com"
7 },
8 "error_code": null
9}

Save oAuthTokenVerificationRequestId — it is required in Step 2.


Step 2 — Complete registration

Pass the oAuthTokenVerificationRequestId to the registration endpoint. This skips the email OTP step because the email is already verified by the OAuth provider.

cURL
JavaScript
Python
$curl -X POST https://api.vlenseg.com/api/DigitalIdentity/Register/StepCreate \
> -H "ApiKey: YOUR_API_KEY" \
> -H "Content-Type: application/json" \
> -d '{
> "phoneNumber": "+201234567890",
> "oAuthTokenVerificationRequestId": "SAVED_REQUEST_ID"
> }'

On success the user is registered and a user access token is returned — same as the standard registration flow.


Skip email for an existing user

If a user is already registered but has not verified their email, use VerifyOAuthToken to verify the email via OAuth instead of sending an email OTP:

$curl -X POST https://api.vlenseg.com/api/DigitalIdentity/VerifyOAuthToken \
> -H "ApiKey: YOUR_API_KEY" \
> -H "Content-Type: application/json" \
> -d '{
> "provider": "Microsoft",
> "IdToken": "OAUTH_ID_TOKEN"
> }'

The response is the same shape as StepVerifyOAuthToken — use the returned oAuthTokenVerificationRequestId to complete the pending registration step.


Supported providers

Providerprovider value
Google"Google"
Microsoft (Azure AD B2C)"Microsoft"

Standard registration comparison

StepStandard flowOAuth flow
Send phone OTPRegister/StepVerifyPhone (send)Same
Validate phone OTPRegister/StepVerifyPhone (validate)Same
Verify emailRegister/StepVerifyEmailReplaced by Register/StepVerifyOAuthToken
Complete registrationRegister/StepCreateSame — pass oAuthTokenVerificationRequestId