I Wasted 3 Days on Google Drive 'Open With' OAuth — Here's Everything I Learned
Three days. That's how long it took me to fix a single OAuth error that, in hindsight, had a five-minute solution. The catch? The fix was in a place I never thought to look. If you're building a Google Drive "Open With" App and you're seeing: Error 400: redirect_uri_mismatch ...this post is for you. I'll walk through exactly how to diagnose it, why the usual advice doesn't work, and the specific…
Three days were spent resolving an OAuth error with Google Drive Open With app, despite a simple fix that was overlooked. The issue arose when using ngrok for local development and updating the production redirect URI. The problem was that the redirect_uri in the request did not match a registered redirect URI, even after updating the .env file and redeploying the Docker container.
The reason for this discrepancy was that the redirect_uri in the request was constructed by Google's servers, not the developer's server. To resolve the issue, the actual redirect_uri needed to be obtained from Chrome DevTools and then queried directly from the App Registry using an access token. This revealed that the outdated ngrok URL was hard-coded in the openUrlTemplate field, which needed to be updated to the correct production URL.
Written by urgent.news from Dev.to's reporting — not their text. Machine-written — may contain errors; check the original before relying on it.