Back

Appwrite sending `http://...` as `redirect_uri to Google OAuth instead of `https://` when using SSL

  • 0
  • Accounts
wintercounter✌🏼
7 Oct, 2023, 12:32

I'm using SSL through Cloudflare. Tried to Set FORCE_HTTPS to enabled, but then I end up with infinite redirects. Any ideas what should set?

TL;DR
Appwrite is sending 'http://...' instead of 'https://' as the redirect_uri to Google OAuth when using SSL. The user tried using Flex and Full encryption on Cloudflare, but still encountered issues with 301 requests and ERR_TOO_MANY_REDIRECTS on the homepage. They suggested turning off force redirection on Cloudflare and using `_APP_OPTIONS_FORCE_HTTPS`, but this resulted in an endless redirection loop. The user asks if a redirection setup is in place and asks for suggestions on how to resolve the issue. Solution: It seems that the issue may be related to the `_APP_OPTIONS_FORCE_HTTPS` setting. The user should ensure that
darShan
7 Oct, 2023, 13:10

is _APP_OPTIONS_FORCE_HTTPS set to enabled? I had this issue in the past, not sure exactly how I fixed this.

wintercounter✌🏼
7 Oct, 2023, 13:28

yeah, if i do that I end up in an endless redirection loop

darShan
7 Oct, 2023, 13:53

do you have a redirection setup somewhere? like redirect http to https?

wintercounter✌🏼
7 Oct, 2023, 13:59

only on cloudflare

wintercounter✌🏼
7 Oct, 2023, 13:59

but when I setup Google auth, the UI wants me to use to use a Callback URL starting with HTTPS

darShan
7 Oct, 2023, 14:01

can you try turning off force redirection on cloudflare & see if _APP_OPTIONS_FORCE_HTTPS works?

wintercounter✌🏼
7 Oct, 2023, 14:02

yeah, I try

wintercounter✌🏼
7 Oct, 2023, 14:06

same, I get ERR_TOO_MANY_REDIRECTS right on the homepage

wintercounter✌🏼
7 Oct, 2023, 14:08

the requests return 301 for some reason

wintercounter✌🏼
7 Oct, 2023, 14:12

ok, using Full encyption on CF seems like it's working

wintercounter✌🏼
7 Oct, 2023, 14:12

i was using Flex before

wintercounter✌🏼
7 Oct, 2023, 14:14

and now it's sending correct redirect_uri

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