Skip to content
Back

OAuth2 Google Sign-In Redirect Loop in AppWrite Flutter SDK (v15.0.1)

  • 1
  • Auth
  • Flutter
Ankit Maniya
22 Apr, 2025, 17:00

I am using the Flutter SDK appwrite: 15.0.1 to perform createOAuth2Session. This method successfully opens the "Sign in with Google" screen with the account selection options.

However, after selecting an account, although I can see that an entry is created in Appwrite Auth, the flow redirects back to the same "Sign in with Google" screen with the account selection options, instead of completing the login process.

TL;DR
Developers are experiencing a OAuth2 Google Sign-In Redirect Loop issue with the AppWrite Flutter SDK (v15.0.1). Suggestions include checking the AndroidManifest.xml file and removing specific lines like `await _checkSessions();`. Additionally, removing `app_links` and verifying the manifest contents could help resolve the problem.
Ankit Maniya
22 Apr, 2025, 17:01

My setup: AndroidManifest.xml

TypeScript
<activity android:exported="true"
            android:name="com.linusu.flutter_web_auth_2.CallbackActivity">
            <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-67ec7d3a002677dbcf65" />
            </intent-filter>
        </activity>
Ankit Maniya
22 Apr, 2025, 17:05

OAuth2 Google Sign-In Redirect Loop in AppWrite Flutter SDK (v15.0.1)

Steven
22 Apr, 2025, 17:33

what's your code?

Ankit Maniya
22 Apr, 2025, 17:33

Let me share you

Ankit Maniya
22 Apr, 2025, 17:35

here is the code

Steven
22 Apr, 2025, 17:48

can you share more of the manifest?

Steven
22 Apr, 2025, 17:48

what if you remove await _checkSessions();?

Ankit Maniya
22 Apr, 2025, 17:49

I already tried but got same issue

Ankit Maniya
22 Apr, 2025, 17:49

Do you mean AndroidManifest.xml?

Ankit Maniya
22 Apr, 2025, 17:50

AndroidManifest.xml

Steven
22 Apr, 2025, 17:52

android:launchMode="singleTop" looks good...

Steven
22 Apr, 2025, 17:52

maybe app_links is causing issues?

Ankit Maniya
22 Apr, 2025, 17:53

I am not using it. let me remove from the pubspec.yml and try it.

Ankit Maniya
22 Apr, 2025, 17:58

I tried to remove that but not worked for more information see this logs if you can Understand!

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