Skip to main content

Serverless Identity Verification with Lambda@Edge & Didit

Discover how to build a serverless identity verification proxy using AWS Lambda@Edge and Didit. This approach enhances security, reduces latency, and simplifies compliance by offloading sensitive data processing to the edge.

Serverless Identity Verification with Lambda@Edge & Didit

Contents

In this guide

Jump to the part you need.

Edge Computing for SecurityLeveraging AWS Lambda@Edge allows for identity verification requests to be processed closer to the user, enhancing security by minimizing data transit time and reducing the attack surface on origin servers.

Improved Performance and User ExperienceBy routing verification through a serverless edge function, businesses can significantly reduce latency for global users, leading to faster loading times and a smoother, more responsive identity verification process.

Simplified Compliance and Data HandlingLambda@Edge can act as a proxy, ensuring that sensitive identity verification data is handled securely and in compliance with regional regulations, without directly exposing your backend systems to raw identity data.

Seamless Integration with DiditDidit's modular, API-first identity verification platform integrates effortlessly with serverless architectures like Lambda@Edge, offering a flexible and scalable solution for ID Verification, Liveness, and AML Screening without complex setup or backend development.

The Need for Edge-Based Identity Verification

In today's global digital landscape, businesses face increasing pressure to verify user identities quickly, securely, and compliantly. Traditional identity verification methods often involve routing all traffic through a central server, which can introduce latency, security vulnerabilities, and compliance challenges, especially for a geographically dispersed user base. This is where edge computing, specifically AWS Lambda@Edge, combined with a powerful identity verification platform like Didit, offers a transformative solution.

By processing identity verification requests at the edge – closer to your users – you can drastically reduce latency, improve user experience, and enhance the overall security posture. Imagine a user in Europe initiating an ID verification process; instead of their data traveling to a server in North America, it's processed by a Lambda@Edge function deployed in a European AWS region. This not only speeds up the process but also helps in adhering to data residency requirements.

Architecting a Serverless Proxy with Lambda@Edge

AWS Lambda@Edge allows you to run Lambda functions in response to Amazon CloudFront events, enabling you to execute code at AWS edge locations. This makes it an ideal candidate for building a lightweight, highly available, and performant proxy for identity verification. The core idea is to intercept verification requests at the edge, forward them to Didit's API, and then process the response before it reaches your origin server or the end-user's browser.

Here's a simplified flow:

  1. A user initiates an identity verification request from their device (e.g., uploading an ID document for Didit's ID Verification).
  2. The request hits an Amazon CloudFront distribution configured to trigger a Lambda@Edge function.
  3. The Lambda@Edge function acts as a secure proxy, adding necessary API keys or transforming the request payload before forwarding it to Didit's API endpoint.
  4. Didit processes the verification (e.g., performing Passive & Active Liveness, 1:1 Face Match, or AML Screening).
  5. Didit sends the verification result back to the Lambda@Edge function.
  6. The Lambda@Edge function can then modify the response, cache it, or forward it to your origin server or directly to the user's browser, depending on your architecture.

This serverless approach means you don't need to provision or manage any servers, and you pay only for the compute time consumed by your Lambda functions.

Enhancing Security and Compliance at the Edge

Security is paramount when dealing with sensitive identity data. By using Lambda@Edge as a proxy, you can significantly bolster your security posture. The edge function can:

  • Obfuscate API Keys: Your Didit API keys can be securely stored as environment variables within the Lambda function, preventing them from being exposed in client-side code.
  • Validate Requests: Implement custom logic to validate incoming requests, rejecting malformed or suspicious requests before they even reach Didit or your backend.
  • Data Minimization: Ensure only necessary data is sent to Didit and that sensitive information is not logged unnecessarily.
  • Regional Compliance: By deploying edge functions in specific AWS regions, you can help ensure that data processing occurs within geographical boundaries, aiding compliance with regulations like GDPR or CCPA.

Didit's robust security measures, including end-to-end encryption and secure data handling, complement this edge-based architecture, creating a fortified verification pipeline.

Practical Implementation with Didit's API

Implementing this solution with Didit is straightforward due to its developer-first approach and clean APIs. You would typically use Didit's ID Verification for document scanning, Passive & Active Liveness for fraud prevention, and AML Screening & Monitoring for compliance. For age-restricted services, Didit's Age Estimation can be integrated seamlessly.

Your Lambda@Edge function would make calls to Didit's API endpoints using the didit_create_session or other relevant tools. For example, to initiate an ID verification session, your Lambda@Edge function could construct a request to Didit's API, passing the necessary workflow_id and any vendor_data for session tracking. The response from Didit, containing the session URL or verification result, would then be handled by the edge function before being returned to the client.

This setup allows for dynamic workflow selection based on user context or location, all orchestrated at the edge without burdening your core infrastructure. Didit's modular architecture means you can easily swap or add verification steps within your workflows, and the edge function will adapt accordingly.

How Didit Helps

Didit is the AI-native, developer-first identity platform that perfectly complements a serverless, edge-based architecture. With its modular design and API-first approach, Didit makes it incredibly easy to integrate sophisticated identity verification capabilities into your Lambda@Edge functions. Didit offers a comprehensive suite of products, including ID Verification (OCR, MRZ, barcodes), Passive & Active Liveness, 1:1 Face Match, AML Screening & Monitoring, and Proof of Address. For specialized needs like age-restricted content, Didit's Age Estimation provides a privacy-preserving solution.

Didit stands out with its Core KYC, and pay-per-use pricing lets businesses get started without upfront costs. Its AI-native engine ensures highly accurate and efficient verifications, while the modular architecture provides unparalleled flexibility. There are no setup fees, and the pay-per-successful-check model ensures cost-effectiveness. By offloading the complexities of identity verification to Didit, you can focus on your core business, knowing that your verification processes are secure, compliant, and performant at the edge.

Ready to Get Started?

Ready to see Didit in action? Get a free demo today.

Start verifying identities for free with Didit's free tier.

Try it

Try this in the sandbox

Run the check this guide describes, free.

ID Verification

The product this post is about, taken from its topic. Run it free in the sandbox.

$0.15 per checkStart free

Author

Alberto Rosas

Co-founder and CEO

Alberto Rosas

Alberto Rosas

Co-founder and CEO

About Didit

Questions

Blog questions

Who writes the Didit blog?
The Didit team. Guides reviewed by Alberto Rosas, co-founder and CEO, carry his byline. The rest are published as Didit.
Which topics does the blog cover?
Eight topics: ID verification, business verification (KYB), AML, sanctions and compliance, fraud prevention, transaction monitoring and crypto, country guides, agents and developers, and product updates.
Is the blog available in my language?
Yes, in 15 languages: English, Spanish, French, German, Brazilian and European Portuguese, Catalan, Russian, Arabic, Chinese, Japanese, Hindi, Indonesian, Korean and Swahili. Not every post is translated, so each language shows the posts it has.
Where do I find product updates?
In the changelog at /changelog/ and under the Product updates topic.
Are these posts legal advice?
No. Regulation posts explain rules; your legal team decides how they apply.
How do I find posts on one topic?
Open one of the eight topics, or search the blog.
Are posts dated?
Yes. Every post shows when it was published and when it was last updated.
Do posts link to the docs?
Developer posts link to the matching page on docs.didit.me and to the API reference.
Is the blog the same as the docs?
No. The blog explains rules, markets and product changes for a general reader, while docs.didit.me holds the integration guides and the API reference. Developer posts link the matching docs page and the API reference they describe.

Compliance built in

Audited, certified and attested.

We hold the certifications and build each country's rules into your flows, so you can launch anywhere without worrying. Security and Compliance center

  • Regulation encoded into your flows

    Tell us what you do and where. Didit lists the rules that apply to you, with sources, and builds the checks each country needs into one workflow.

  • Ready for AMLR

    Every requirement of the new EU anti-money laundering rules, from checking customers to human review, is already covered by a Didit check.

  • Tested in Spain's Treasury sandbox

    Spain's Treasury published its supervised sandbox report on Didit's NFC plus active liveness onboarding; SEPBLAC took part and valued the added measures positively.

  • Audited, not self-declared

    iBeta Level 1 and Level 2. Liveness tested under ISO/IEC 30107-3.

Compliance assistant

Your obligations · 3 regions

EU · AMLRCustomer due diligence, human reviewCovered
Illinois, Texas, ColoradoExplicit biometric consentCovered
Germany · Youth protectionVerified adults only (JMStV)Covered
Workflow checked. Every obligation is met
  • SOC 2 Type 2
  • ISO 27001
  • iBeta Level 1 and Level 2
  • EU regulator attestation
  • FSM youth protection
  • GDPR
  • EBA remote onboarding
  • MiCA compatible
  • FIDO Alliance member
  • AMLREU AML Regulation ready

Integration · Didit MCP

Run Didit from your own AI agent

Connect Didit to Claude, Cursor, VS Code or ChatGPT and just ask in plain words. Your agent can do anything you can do in the console, with the same permissions you have.

Add to ClaudeChatGPT
Didit Academy · Lesson 04 · Use Didit with MCP
  • Build workflowsDescribe the checks you need. The agent creates and publishes the flow.
  • Run investigationsAsk why a session was declined, review cases, search people and companies.
  • Change rulesCreate payment rules, test them on past data and switch them on.
  • Pull reportsAsk for numbers, exports or the audit log.

Verify your first user today.

Start free

Free sandbox. Credit applies to work-email sign-ups.