[firebase_auth]: Authentication redirection from the browser fails due to taskAffinity configuration
[READ] Step 1: Are you in the right place?
Issues filed here should be about bugs in the code in this repository. If you have a general question, need help debugging, or fall into some other category use one of these other channels:
- For general technical questions, post a question on StackOverflow with the firebase tag.
- For general Firebase discussion, use the firebase-talk google group.
- For help troubleshooting your application that does not fall under one of the above categories, reach out to the personalized Firebase support channel.
[REQUIRED] Step 2: Describe your environment
- Android Studio version: Ladybug
- Firebase Component: Auth
- Component version: _____
[REQUIRED] Step 3: Describe the problem
After authenticating the Android app using AppleAuthProvider, the app does not return from the browser due to the taskAffinity configuration. Removing taskAffinity resolves the issue.
Steps to reproduce:
When attempting to authenticate with AppleAuthProvider, the app does not redirect back after a successful login
Relevant Code:
<activity
android:name=".MainActivity"
android:exported="true"
android:launchMode="singleTop"
android:taskAffinity=""
I couldn't figure out how to label this issue, so I've labeled it for a human to triage. Hang tight.
Hi @rohitsangwan01, thank you for reaching out and reporting the issue. I was able to reproduce the behavior your raised. Let me raise this to our engineers and see what we can do here. Thanks!
@rohitsangwan01 , Thank you, this solved the issue I was having. the same behaviour is present when signing in with Microsoft on Android. Where the Microsoft login page would return 'AADSTS900561 The endpoint only accepts POST requests, Received a GET request' after successfully logging you in but refusing to take you back to the app.
Flutter Version 3.27.4
firebase_auth: ^5.5.1 firebase_core: ^3.6.0 firebase_crashlytics: ^4.2.0 firebase_analytics: ^11.3.6
settings.build.gradle
plugins {
id "dev.flutter.flutter-plugin-loader" version "1.0.0"
id "com.android.application" version "8.1.0" apply false
id "org.jetbrains.kotlin.android" version "2.1.10" apply false
id "com.google.gms.google-services" version "4.4.2" apply false
id "com.google.firebase.crashlytics" version "3.0.2" apply false
}
app/build.gradle
dependencies {
implementation(platform("com.google.firebase:firebase-bom:33.7.0"))
implementation("com.google.firebase:firebase-auth")
implementation("com.google.firebase:firebase-analytics")
implementation("com.google.firebase:firebase-crashlytics")
implementation("com.google.android.gms:play-services-auth:21.3.0")
}