Back

appwrite with ngrok and SSL

  • 0
  • Self Hosted
Guille
27 Feb, 2024, 12:13

I'm trying to configure appwrite with SSL handled by ngrok and use oauth2

I'm not sure if this is a bug or not, my url includes ssl, but not the request. Looking the code seems like the problem is here: https://github.com/appwrite/appwrite/blob/main/app/controllers/api/account.php#L316

shouldn't getProtocol be https in my case? https://github.com/utopia-php/swoole/blob/master/src/Swoole/Request.php#L90-L102

I'm will try to explain more about my flow, first considerate:

  1. The login page uses createOAuth2Session, the request to appwrite is: https://appwrite.ngrok.domain.app/v1/account/sessions/oauth2/github?success=successurl&failure=failureurl&project=projectid
  2. appwrite make a request to github, but in redirect_uri there isn't https (as shown in the image)

and as the redirect_uri doesn't match, I got an error The redirect_uri MUST match the registered callback URL for this application

TL;DR
Developers are trying to configure appwrite with ngrok and SSL for OAuth2 but facing an issue where the request URL does not include HTTPS. The issue might stem from a specific code GitHub file. The flow involves appwrite running on ngrok with SSL, while the frontend is on localhost making requests to the ngrok domain. When using the login page and `redirect_uri` to GitHub, there's no HTTPS causing an error. To resolve, ensure the `redirect_uri` in the request matches the registered callback URL for the application.
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