Back

OAuth with Cloudflare Tunnels

  • 0
  • Self Hosted
  • Auth
Brinamite
25 Oct, 2024, 09:35

I would like to set up OAuth (specifically Google). on my self-hosted instance. I am running it through Cloudflare Tunnels but I only managed to get it to run on HTTP. This is forcing the redirect URL of the OAuth to be HTTP and thus being stuck in a redirect loop.

I tried setting appwrite to use HTTPS using the following settings:

TypeScript
_APP_ENV: production
_APP_OPTIONS_FORCE_HTTPS=enabled
_APP_DOMAIN=test-appwrite.domain.com
_APP_DOMAIN_FUNCTIONS=test-appwrite.domain.com
_APP_DOMAIN_TARGET=test-appwrite.domain.com
_APP_SYSTEM_SECURITY_EMAIL_ADDRESS=myemail@mail.com
_APP_EMAIL_CERTIFICATES=myemail@mail.com

On Cloudflare I have SSL mode to Full.

I am also attaching my tunnel setup on Cloudflare Zero Trust.

I am getting a bad gateway error at the moment. Please let me know if I am messing something up, or this is not necessarily the way to go to get OAuth working

TL;DR
Developers are attempting to set up OAuth with Google on their self-hosted instance running through Cloudflare Tunnels. They have only been able to get it running on HTTP, resulting in a redirect loop due to the HTTP redirect URL. They have tried setting up HTTPS in Appwrite but are encountering a bad gateway error. They are seeking advice on how to correctly configure OAuth with Cloudflare Tunnels and Appwrite to work over HTTPS.
Reply

Reply to this thread by joining our Discord

Reply on Discord

Need support?

Join our Discord

Get community support by joining our Discord server.

Join Discord

Get premium support

Join Appwrite Pro and get email support from our team.

Learn more