Back

[Closed] Google sign in opens in Private Browsing

  • 0
  • Flutter
Raj
6 Dec, 2023, 18:54

Hey Guys. I'm creating a Flutter app with Google Sign in. Set up the OAuth credentials in GCP with the redirect url from Appwrite. I'm calling the createOAuth2Session method from Account. However, it opens up a private browsing window and this does not show the existing logged in accounts for selection. I need to enter the username and password and go through the normal authentication process. What do I need to do to make sure the existing logged in accounts show up at this stage? Any help would be highly appreciated!

Below is the code:

TL;DR
Title: [Closed] Google sign in opens in Private Browsing Messages: - User was able to solve the problem by changing 'preferEphemeral' to false. - The issue was narrowed down to the FlutterWebAuth2.authenticate method, where 'preferEphemeral' was set to true. - Setting 'preferEphemeral' to false resulted in a redirect error. - User tried changing default browser to Chrome but the issue persisted. - User confirmed there were no other private windows open. - User clarified that this was for a Flutter Macos desktop app. - User provided code snippet. Solution: User found that
Drake
6 Dec, 2023, 19:36

How do you know it's a private browsing window?

Raj
6 Dec, 2023, 20:33

It explicitly says that in the browser

Drake
6 Dec, 2023, 20:33

This is flutter desktop? On what OS?

Raj
6 Dec, 2023, 20:50

Flutter Macos desktop app

D5
6 Dec, 2023, 21:08

Maybe you had another private window opened?

Raj
6 Dec, 2023, 21:39

I tried multiple times with this - made sure that there were no private window open. Primary browser is Safari, changed that to Chrome as well and tried. Still no change.

Drake
7 Dec, 2023, 02:05

What happens with chrome as the default?

Raj
7 Dec, 2023, 13:23

I was able to narrow down the issue to this piece of code. In FlutterWebAuth2.authenticate, the 'preferEphemeral' is set to 'true'. This opens up the window in private browsing and does not let me access the already signed in accounts. I tested this separately using flutter_web_auth2 package and noted the difference between setting it to true and false. However, in the below code, if I try to set 'preferEphemeral' to 'false', then I get a redirect error.

Raj
8 Dec, 2023, 14:19

I was able to close this one by changing 'preferEphemeral' to false. We can close this. Thanks for the help.

fafa
8 Dec, 2023, 15:08

Hey.

If your issue is solved, please add [Solved] to the beginning of the title. Thanks!

Raj
8 Dec, 2023, 15:09

[Closed] Google sign in opens in Private Browsing

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