I’m stuck with a Google OAuth problem. Everything’s fine when I use the full spreadsheets scope. But when I switch to the read-only scope, it’s a no-go. I get this weird message saying the app isn’t verified for Google Sign In yet.
Here’s what I’ve tried:
# This works
scope = 'https://www.googleapis.com/auth/spreadsheets'
# This doesn't work
scope = 'https://www.googleapis.com/auth/spreadsheets.readonly'
With the read-only scope, I hit a wall. The auth process fails, and I can’t figure out why. Isn’t the read-only scope supposed to be less risky? Why is Google giving me grief over it?
Has anyone run into this before? Any ideas on how to fix it? I’m scratching my head here!
hey man, i feel ur pain. google’s api can b a real headache sometimes. have u tried clearin ur browser cache and cookies? that fixed a similar issue 4 me once. also, double check ur client ID and secret - sometimes they need a refresh. if nothin else works, maybe hit up google’s support forums. they can be slow, but sometimes u get lucky with a quick fix.
I’ve been down this road before, and it’s a tricky one. The issue you’re facing is likely due to how Google handles different scopes for unverified apps. Counter-intuitive as it may seem, the more permissive scope sometimes gets a pass while the restricted one throws up red flags.
Here’s what worked for me: I temporarily switched back to the full scope, then went into the Google Cloud Console and explicitly added the read-only scope to my project’s OAuth consent screen. After that, I was able to use the read-only scope without issues.
It’s also worth checking if you’ve enabled the Google Sheets API in your project. Sometimes that’s the culprit, even if you think you’ve done it already.
If all else fails, you might need to go through the verification process with Google. It’s a bit of a pain, but it’s doable. Just be prepared for some back-and-forth with their team.
I’ve encountered this exact problem in my projects. The root cause often lies in how Google treats different scopes for unverified apps. Here’s a workaround that’s worked for me: Go to your Google Cloud Console and navigate to the OAuth consent screen. Add the read-only scope (‘https://www.googleapis.com/auth/spreadsheets.readonly’) explicitly to your project’s configuration. This sometimes resolves the issue without needing full verification. If that doesn’t work, double-check that you’ve enabled the Google Sheets API for your project. It’s an easy step to overlook. As a last resort, you might need to initiate the verification process with Google. It’s time-consuming but necessary for some use cases. Remember to clearly explain your app’s functionality and data usage to speed up the process.