cloudflare proxy + fly displaying strange behavior with google oauth

Hi all,

This might be a bit too comprehensive of a question to ask here, but I thought I’d give it a shot. I am currently hosting a fly app behind a Cloudflare Proxy. This is working well, but while integrating Google oAuth I am running into an error.

Google requires me to use the .fly.dev address for the oauth redirect rather than the proxy, which works initially but upon redirect to the app, it hits .fly.dev, which has no valid certificate, and fails.

Wondering what workarounds I have available to me. I was thinking of setting up a redirect from .fly.dev to the proxy, but I don’t think that would overcome the fundamental problem.

Thanks,

Can you link to the docs that says you have to use fly.dev? Just use your canonical domain.

@khuezy When using the canonical domain it errors, telling me that the redirect uri requested is the fly.dev domain - I believe this is an indication of a DNS misconfiguration, but I’m not sure what it is.

The redirect URL is defined at the oauth layer. You probably misconfigured it on Google.

@khuezy Hmm… That’s what I was thinking initially, but the only configuration I’ve done so far is just adding the redirect & origin URLs. When I change it to the .fly.dev address, requesting from the .org generates a successful signIn but redirects to the .fly.dev domain obviously.

The error message tells me that the .org is requesting from the .fly.dev, which gives me the impression that I’ve misconfigured the DNS certs and it isn’t actually requesting from the canonical domain.

Certs has nothing to do with redirects though. Most likely an app or oauth misconfiguration.

Yep, you were right. Thanks for pointing me in the right direction!

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.