
Founding Engineer
How We Scaled Secure OAuth Integrations in a Multi-Tenant SaaS

"It's just a few OAuth tokens. How hard can it be?" — me, before everything went wrong.
If you've ever built integrations with third-party services, you've probably thought the same. What started as a simple Gmail integration quickly turned into one of the most complex architectural challenges we've faced at Youkti.ai.
This is the story of how we evolved from scattered, hardcoded OAuth logic to an enterprise-grade connector management system trusted with sensitive customer data.
Our first connector was Gmail. The OAuth guide looked straightforward: authenticate, store tokens, make API calls. We implemented it quickly and moved on.
Then came Outlook. Then Salesforce. Then Google Calendar, Slack, and more.
Before long, we had:
The warning signs were obvious—but like many startups, we prioritized shipping features over infrastructure.
Everything changed when a potential enterprise customer sent us a 47-page security questionnaire.
Questions included:
The honest answers were uncomfortable:
That questionnaire exposed not just gaps—but real risk.
Before rebuilding, we mapped everything we had:
It wasn't just messy—it was a security incident waiting to happen.
We rebuilt the system with clear principles:
Here's what changed.
Instead of separate schemas per connector, we introduced a single unified connector model.
Benefits included:
Each sensitive field now tracks:
In multi-tenant SaaS, isolation failures are catastrophic. We implemented defense in depth:
1. JWT-based tenant context embedded in every request
2. Middleware validation to verify tenant access
3. Mandatory tenant filtering at the query layer
4. Tenant-specific encryption keys for all sensitive data
Even if multiple layers fail, encrypted data remains isolated.
OAuth tokens are effectively keys to customer systems. Storing them in plain text was unacceptable.
Our encryption system:
Security improved without sacrificing performance or developer velocity.
Enterprise customers expect clear answers:
We built an audit system that logs:
Using a context manager pattern ensured consistent logging without developer overhead.
Connectors fail silently unless you watch them.
Every connector now has:
Each integration also receives a security score based on encryption status, key age, and anomalies. Scores below a defined threshold are automatically flagged for review.
Six months later, the impact was clear:
Most importantly, we gained confidence in our security posture.
Today, Youkti.ai supports enterprise integrations including:
All powered by the same unified, secure connector platform.
Looking back, a few principles stand out:
Enterprise-grade connector management isn't a single feature—it's a system of security, reliability, and developer experience working together.
If you're early in your integration journey, don't wait for the wake-up call. The cost of fixing insecure connectors later is always higher than doing it right from the start.
Your future self—and your future enterprise customers—will thank you.