OAuth & Authentication

Why Teams Choose Managed or Serverless OAuth Infrastructure

What changes when you stop running OAuth infrastructure yourself, and when running it yourself is still the right call.

3 min read
On this page
  1. What "serverless OAuth" means
  2. Why teams choose a managed approach
  3. When to run it yourself
  4. What to look for in a managed service
  5. The architecture in practice
  6. Where Pathfix fits
  7. Frequently asked questions

When a SaaS team adds OAuth integrations, the default plan is often to run the OAuth machinery on their own servers: callback endpoints, a token database, refresh jobs and provider configuration. An alternative is to hand that layer to a managed, serverless service and focus on the integration features themselves.

This article explains what "serverless OAuth" means in practice, why teams choose it, and when running it yourself is still the better option.

What "serverless OAuth" means#

"Serverless" doesn't mean there are no servers. It means you don't run them. The OAuth infrastructure exists, but it's operated by a provider rather than by your team.

In a self-managed setup, your team owns:

  • Callback endpoints for each provider.
  • Secure storage for tokens and encryption keys.
  • Refresh logic and background jobs.
  • Provider-specific configuration and error handling.
  • Monitoring, scaling and incident response for all of the above.

In a managed setup, those responsibilities move to a service. Your application starts connections, makes API requests through the service, and handles the results.

Why teams choose a managed approach#

OAuth infrastructure isn't the product#

Customers pay for what an integration does, such as a synced calendar or an updated CRM record, not for how tokens are refreshed. Time spent on token plumbing is time not spent on features.

Every provider is different#

The OAuth specification leaves room for variation, and providers use it. Refresh token rules, rotation, scopes, redirect requirements and error responses differ. Supporting many providers means maintaining many small variations, each of which can change without much notice.

The work doesn't end at launch#

The first integration is a project. Keeping integrations working is ongoing: provider changes, expired refresh tokens, revoked access, new scopes, app review renewals. A managed service spreads that maintenance across many customers.

Smaller teams lack on-call depth#

A token service sits in the path of every integration request. Running it well means monitoring, alerting and someone available when it breaks. Small teams often can't justify that.

Security-sensitive infrastructure is costly to get right#

Encrypting tokens properly, isolating keys, restricting access and auditing usage are all achievable, but they're specialized work.

When to run it yourself#

Managed infrastructure isn't always right. Consider self-managing when:

  • Tokens must stay in your environment for regulatory or contractual reasons.
  • You support one or two providers and don't expect that to grow.
  • You already operate similar infrastructure and have the people to maintain it.
  • You need behaviour no service offers, such as an unusual provider or custom flow.

What to look for in a managed service#

RequirementWhy it matters
Your own OAuth apps and credentialsConsent screens show your brand; you keep the provider relationship and can switch later
Direct access to provider APIsYou can call any endpoint the provider offers, not only a predefined set
Provider coverageCovers your current list and likely future additions
Clear connection lifecycleRefresh, revocation and reconnection are handled and visible
Security documentationYou can answer customer questions about where tokens live and how they're protected
Production track recordEvidence it has run reliably at scale

The architecture in practice#

With a managed OAuth layer:

  1. Your product shows a "Connect" button.
  2. The user authorizes through the managed service's flow, using your OAuth app.
  3. The service stores and refreshes the tokens.
  4. Your backend calls the provider's API through the service, identifying which user's connection to use.
  5. Your code decides which endpoints to call and what to do with the responses.
AAAWgmp1bWIAAAAeanVtZGMycGEAEQAQgAAAqgA4m3EDYzJwYQAAABZcanVtYgAAAEdqdW1kYzJtYQARABCAAACqADibcQN1cm46YzJwYTpmOTVjMGM2OC04ZTQ2LTQ1M2ItODI5Zi1kNjI2N2Y3NjZjN2MAAAADl2p1bWIAAAApanVtZGMyYXMAEQAQgAAAqgA4m3EDYzJwYS5hc3NlcnRpb25zAAAAALxqdW1iAAAARGp1bWRjYm9yABEAEIAAAKoAOJtxE2MycGEuaW5ncmVkaWVudC52MwAAAAAYYzJzaOTF6F1vIYVPMLTdjuQmZBUAAABwY2JvcqNpZGM6Zm9ybWF0bWltYWdlL3N2Zyt4bWxqaW5zdGFuY2VJRHgseG1wOmlpZDo0NzQ0NjE4OC1lNTVlLTRhNTEtOTc1Yi1jZDI4OTcxYzllOTZscmVsYXRpb25zaGlwaHBhcmVudE9mAAAB4mp1bWIAAABBanVtZGNib3IAEQAQgAAAqgA4m3ETYzJwYS5hY3Rpb25zLnYyAAAAABhjMnNoxI1daGPifu/I+DqQxKTz2QAAAZljYm9yomdhY3Rpb25zgqJmYWN0aW9ua2MycGEub3BlbmVkanBhcmFtZXRlcnOha2luZ3JlZGllbnRzgaJjdXJseC1zZWxmI2p1bWJmPWMycGEuYXNzZXJ0aW9ucy9jMnBhLmluZ3JlZGllbnQud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AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAPZYQIStzc/lJqrWVdC+9xePS2rM+hOLU9GIYsInZxCJG4GEcNEHWtWeg8TfHTLfOsmmt4AJooasErQ8v6Yp9BtasFU=OAuth 2.0 authorization code flow with PKCESequence between the user, the SaaS application, the authorization server and the resource API. 1, the user clicks Connect account. 2, the SaaS application redirects the user to the authorization server with scopes, state and a PKCE challenge. 3, the user approves access. 4, the authorization server redirects back to the SaaS application with an authorization code. 5, the SaaS backend exchanges the code and PKCE verifier for tokens. 6, the SaaS application calls the resource API with the access token. 7, the resource API returns the requested data.UserSaaS applicationAuthorization serverResource API1Clicks “Connect account”2Redirects to authorizescopes · state · PKCE challenge3Approves access4Redirects backauthorization code5Exchanges code for tokenscode + PKCE verifier6Calls API with access token7Returns requested data
The flow is the same. What changes is who runs the callback, the token store and the refresh logic.

Your application still owns the API logic. Managed OAuth removes the authorization infrastructure, not the integration design.

Where Pathfix fits#

Pathfix OAuth is managed OAuth infrastructure. It handles the authorization flow, token storage, refresh and authenticated API passthrough across 350+ providers, with no servers for you to set up. You use your own OAuth apps and credentials, and your application calls providers' own APIs through Pathfix. Pathfix has been in production for 6+ years and powers 15,000+ apps.

See supported providers, the security page and the documentation.

Frequently asked questions#

Does managed OAuth mean my data passes through a third party?#

API requests made through the passthrough route through the service. Review the provider's security documentation and data handling to confirm it fits your requirements.

Can I move to self-hosting later?#

If you own your OAuth app registrations, switching is more practical. Users may need to reconnect depending on how tokens can be migrated.

Is it more expensive than building?#

Compare the subscription with the engineering time to build and maintain the equivalent, including on-call and provider changes, not just the initial build.