Skip to content

Redirect URL not working properly on android #7379

@WaqasFarooqSobha

Description

@WaqasFarooqSobha

[REQUIRED] Step 2: Describe your environment

  • Android Studio version: Android Studio Narwhal Feature Drop | 2025.1.2 Patch 1
  • Firebase Component: Auth (Database, Firestore, Storage, Functions, etc)
  • Component version: 6.0.2

[REQUIRED] Step 3: Describe the problem

Microsoft login with Firebase Authentication (signInWithRedirect) works correctly on iOS but fails on Android with different browsers like Google Chrome and Samsung internet
Observed Behavior

On Android devices:
After redirecting to Microsoft login and completing login process it shows
"Unable to process request due to missing initial state. This may happen if browser sessionStorage is inaccessible or accidentally cleared. Some specific scenarios are - 1) Using IDP-Initiated SAML SSO. 2) Using signInWithRedirect in a storage-partitioned browser environment.".

Login succeeds only after retrying multiple times by refreshing page and then it redirects back to application with success
On iOS (Safari), login works consistently without errors.

Steps to reproduce:

Just try to login with microsoft on Android it will redirect to browser after completing login process( email, password authentication) it shows error message inside the browser

Relevant Code:

final microsoftProvider = MicrosoftAuthProvider();

  UserCredential userCredential;
  // microsoftProvider.setCustomParameters({
  //   'login_hint': params.email,
  // });
  if (kIsWeb) {
    userCredential = await FirebaseAuth.instance.signInWithPopup(microsoftProvider);
    debugPrint(userCredential.toString());
  } else {
    userCredential = await FirebaseAuth.instance.signInWithProvider(microsoftProvider);
  }

Image

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions