Back

Windows - Oauth2

  • 1
  • Flutter
  • Auth
  • Cloud
Arnav
28 Apr, 2024, 19:50

I have been trying to login via google on my flutter app running on windows. The redirect URI is correct in URL state as well as in my code. But I still get

TypeScript
Missing redirect URL
Your OAuth login flow is missing a proper redirect URL. Please check the OAuth docs and send request for new session with a valid callback URL.

This is my flutter code

TypeScript
 var _codeListenerServer = await HttpServer.bind('localhost', 0);
      print('Listening on localhost:${_codeListenerServer.port}');
      _account.createOAuth2Session(provider: "google",success: "http://localhost:${_codeListenerServer.port}/auth/oauth2/success");

I also tired it without the HttpServer.

Edit : Using appwrite cloud and Flutter SDK version 11.0.1 tried it with higher 12.0.1 version as well facing the same problem

TL;DR
Developers trying to implement Google login on a Flutter app in Windows are facing an issue with OAuth2 redirect URL, despite having the correct URI in both the code and URL state. The error message "Missing redirect URL" is being displayed. The developers have tried using an HttpServer with no success. This issue is being encountered while using Appwrite Cloud with Flutter SDK versions 11.0.1 and 12.0.1.
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