Search code examples
androidfirebase-authenticationazure-active-directoryfirebaseuiapple-sign-in

FirebaseUI-Android - Custom Chrome tab not closing automatically after oAuth sign in (Microsoft & Apple)


I'm using FirebaseUI-Android to authenticate using Microsoft and Apple.

I choose either one of the Sign In options and a custom Chrome tab opens with the provider's authentication flow. After successfully signing in using the provider, the authentication screen is re-displayed, with a dark overlay. Pressing once dismisses the dark overlay. The top-left close button must also be pressed in order to return to my app onActivityResult is then called and sign in completes successfully

I would like to eliminate the need to dismiss the dark overlay and press the close button.

This happens with both the Microsoft auth flow and the Apple auth flow.

Here's demonstration of the behaviour: https://giphy.com/gifs/iEuTTe8ud85EpsXCpH/fullscreen


Solution

  • Make sure you are not using android:taskAffinity, all of the activities should either have the same taskAffinity set or don't set it at all otherwise your activities can be grouped in ways you did not intend them to and can result in behaviors like you mentioned. For more information on how taskAffinity affects your activities, please have a look at this link.