Why I Keep a Disposable OAuth Client for Every Environment — and the night production hit mine

How I stopped SSO flakiness during local dev and demos by issuing disposable OAuth clients per environment — and the one time a test client caused a real outage.

Written by: Arjun Malhotra

A laptop on a wooden desk with hands typing and a cup of coffee nearby
Photo by Christopher Gower on Unsplash

It was 10:42 PM. I was in a client demo, screen-sharing the login flow, and the browser threw back an absurdly unhelpful “redirect_uri_mismatch” error. The product lead leaned in. The client refreshed. My heart did too.

We had spent the afternoon wiring up Google SSO for a prototype. Locally I’d used the same OAuth client the staging app used — because setting up a new client is fiddly on Google Cloud, and “it worked on staging.” It did not work on the client’s network. Different host header, different port, different redirect. That night I promised myself two things: never rely on a shared OAuth client for demos, and never debug redirect mismatches in front of paying customers.

Over the next six months I formalised a habit: create a disposable OAuth client for every environment and purpose — local dev, CI, staging, demo, and one obvious “break-glass” client. It’s a tiny operational pattern that saved more evenings than a faster laptop or better Wi‑Fi. It also bit me once in a way that forced me to rethink the implementation.

Why disposable clients beat one-shoe-fits-all

How I set this up (practical, not theoretical)

One honest failure: when disposable clients become accidental production The habit wasn’t perfect. Six months in, an engineer merged a config that pointed a feature flag service at acme-demo-raj-2026 instead of acme-staging-main. The demo client had weaker redirect restrictions and a different consent screen configuration. Overnight we got a burst of SSO errors and a postman flood of support tickets. Worse, because the demo client had been used publicly in a hack event, its consent screen required extra verification, and Google started rate-limiting exchanges for that client_id. Our login rate dropped by ~30% during business hours.

Why it happened:

How we changed the pattern after that night

Tradeoffs you should acknowledge

A few small, practical rules that worked for me

What I actually walked away with Treat OAuth clients as first-class infrastructure: they’re not “just config.” Name them, automate their lifecycle, and add deployment guards so a demo client can’t sneak into production. That single discipline stopped most late-night SSO debugging. The failure we had taught me the real limit: automation and naming are helpful, but without deployment safety nets they’re only organized chaos.

I still wonder how this pattern scales beyond a small team. At what size does the management overhead force a central OAuth governance model? For now, disposable clients and a kill switch keep my evenings intact — and my demos mercifully redirect-free.