Google SSO and Deploy Previews

We are using deploy previews and they all end up in a random URL ending in netlify.app. The problem is that we use Google SSO to log in and Google gives us the error:

Not a valid origin for the client https://deploy-preview…netlify.app has not been registered for client ID … Please go to https://console.developers.google.com and register this origin for your project’s client ID.

Any ideas how to handle this? Is there a way to have all our deploy previews just work with Google SSO?

I can’t see the body of my own post, not sure if something is broken. The question was how to configure Google OAuth to work with the random URLs from deploy previews.

I posted in StackOverflow as well (with a screenshot of the problem): oauth - What's the correct way of using Google SSO with random URLs (for testing)? - Stack Overflow

Hiya @pablofernandezkoinly ,

First off, let me clarify that there is no “random stuff” in your deploy preview URL’s - that’s the PR or MR number from your git provider, assuming you are using the same definition of deploy previews that we do (which is literally “deploys from git of an MR or PR”). If you use some other definition for that term such as “any unpublished deploy” of course, there may be other realities than what I describe.

But to address your concern: perhaps you can instead merge those PR’s or MR’s into a branch - like staging - which will have a nice reliable/steady URL for your testing? cf Sites with multiple domains | Netlify Docs where we document that feature.