Google Sign-In Redirects Back to Account Selection Instead of Closing the WebView
- 0
- Auth
- Flutter
Hello Appwrite Support Team,
I am implementing Google Sign-In in my Flutter app. Everything works perfectly on the emulator. However, on my physical device, when I use the "Sign in with Google" option, it opens an in-app browser to select a Google account.
After successfully signing in and selecting the account, the in-app browser redirects back to the account selection page instead of closing. This behavior differs from the expected outcome where, upon successful authentication, the browser should close, and the app should resume.
I have already declared the necessary activity in the AndroidManifest.xml file.
Here is some code I’ve tried:
<intent-filter android:label="flutter_web_auth_2">
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.BROWSABLE" />
<data android:scheme="appwrite-callback-6749dd62000bc24eac8a" />
</intent-filter>
</activity>```
**service.dart**
``` //* Login a user using google
Future<dynamic> continueWithGoogle() async {
try {
await account?.createOAuth2Session(
provider: OAuthProvider.google,
scopes: [
"profile",
"email",
],
);
return true;
} catch (e) {
return e.toString();
}
}```
**signinmethod.dart**
Due to text limit restriection I can't share signinmethod.dart here, Check out my Google docs for signinmethod.dart code: https://docs.google.com/document/d/1kYKQKKxJagkmimhpolxQFhQ59t9GDuRLOV-me_N6EFs/edit?usp=sharing
Device Details:
Model: Redmi Note 10 Pro Brand: Xiaomi Android Version: 13
Recommended threads
- Error: User (role: guests) missing scope...
I want to send a verification code to the user and the given phone number and check it and create a session right after the user entered the secret. For me that...
- Apple OAuth Scopes
Hi Hi, I've configured sign in with apple and this is the response i'm getting from apple once i've signed in. I cant find anywhere I set scopes. I remember se...
- Sign In With Apple OAuth Help
Hi All! I've got a flutter & appwrite app which Im trying to use sign in with apple for. I already have sign in with google working and the function is the sam...