Back

[SOLVED] Have an issue with OAuth while using 8443 port

  • 0
  • Accounts
  • Web
Maksym Kryvoruchko
26 Jun, 2023, 10:50

My application deployed to single server, the ports 80/443 already busy by front-end of application.

Backend deployed to the same server at 8443 port. Unfortunately I should use it inside of client URL like https://appwrite.mydomain.com:8443/. I try to login with OAuth, afterwards it tries redirect me to https://appwrite.mydomain.com/ instead of using port at the end, and oauth can't complete successfuly.

Before backend was deployed to 80/443 and it works as expected, while port was changed and passed to client URL it stopped work.

The question is: Why appwrite didn't add "8443" port at the end while processing OAuth? Which possible solution do I have?

TL;DR
The issue is with OAuth not recognizing the port number in the URL. OAuth does not allow the use of port numbers in the URL, so when using port 8443, the redirect fails. One solution is to create a subdomain for the backend and make Appwrite listen to ports 80 and 443 of that subdomain. Another possible solution is not mentioned in this thread.
safwan
26 Jun, 2023, 11:32

I'm not a 100% sure, but I think this is an OAuth issue, and not an Appwrite one.

The reason why it worked when backend was on 80/443, is because you don't need to specify the port numbers in the URL for these ports. When you make a plain http request to example.com, it will automatically look at port 80, as it's the standard port for HTTP. Same goes for 443 with HTTPS requests.

8443 is widely used as an alternative to 443, but it's not a standard. With OAuth, I don't think you are allowed to use port numbers in the URL.

That being said, there is another way you can try. Considering your frontend app is on frontend.example.com 80/443, you can create another subdomain backend.example.com and make appwrite listen to ports 80 and 443 of this subdomain

safwan
26 Jun, 2023, 11:32

Hope I was clear lol

Maksym Kryvoruchko
26 Jun, 2023, 12:20

Thanks, closed. 👍

Maksym Kryvoruchko
26 Jun, 2023, 12:20

[SOLVED] Have an issue with OAuth while using 8443 port

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