Skip to content

[firebase_auth]: Crash when returning to the app after authorized with X #17372

@AlexV525

Description

@AlexV525

Is there an existing issue for this?

  • I have searched the existing issues.

Which plugins are affected?

Auth

Which platforms are affected?

iOS

Description

A user has reported that the app has crashed several times when returning to it after being authorized with X in the web tab. The unstable network condition could be somehow affected because the user has reported that a VPN is being used during the process.

Reproducing the issue

  1. Start the authentication flow with the TwitterAuthProvider.
  2. Authorized, and returning the app.
  3. After a few seconds, the app crashes.

The pseudo code I was calling:

Future<void> _startAuth() async {
  final provider = TwitterAuthProvider();
  provider.setCustomParameters({
    'scopes': 'users.read offline.access',
    'lang': 'en',
  });
  final credential = await _$.signInWithProvider(provider);
  final idToken = await credential.user?.getIdToken();
  if (idToken == null) {
    return;
  }
  // Making HTTP requests with `idToken`.
}

Firebase Core version

3.13.0

Flutter Version

3.27.4

Relevant Log Output

See the attached crash log.

Flutter dependencies

Expand Flutter dependencies snippet
dependencies:
- firebase_auth 5.5.2
- firebase_core 3.13.0

transitive dependencies:
- firebase_auth_platform_interface 7.6.2
- firebase_core_platform_interface 5.4.0

Additional context and comments

Detailed information can be found in the log file.

Hardware Model: iPhone 14 (iPhone14,7)
OS Version: iPhone OS 16.7 (20H19)

crashlog_for_github.log

Searched related issues:

Activity

MichaelVerdon

MichaelVerdon commented on May 21, 2025

@MichaelVerdon
Contributor

Hey there, are you able to reliably reproduce this? If so, would you be able to send a full MRE over for further investigation?

added
blocked: customer-responseWaiting for customer response, e.g. more information was requested.
and removed
Needs AttentionThis issue needs maintainer attention.
on May 21, 2025
AlexV525

AlexV525 commented on May 22, 2025

@AlexV525
Author

Hey there, are you able to reliably reproduce this?

Not from my side but the client said it happens 1/10~2/10.

would you be able to send a full MRE over for further investigation?

You mean my development environment? macOS 15.3.2, Xcode 16.2, iOS deployment target 15.5.

added
Needs AttentionThis issue needs maintainer attention.
and removed
blocked: customer-responseWaiting for customer response, e.g. more information was requested.
on May 22, 2025
MichaelVerdon

MichaelVerdon commented on May 22, 2025

@MichaelVerdon
Contributor

Hey there, are you able to reliably reproduce this?

Not from my side but the client said it happens 1/10~2/10.

would you be able to send a full MRE over for further investigation?

You mean my development environment? macOS 15.3.2, Xcode 16.2, iOS deployment target 15.5.

Hi there, I meant a full code example or a repo showing how you implemented it. Do you also know what devices these users were using?

added
blocked: customer-responseWaiting for customer response, e.g. more information was requested.
and removed
Needs AttentionThis issue needs maintainer attention.
on May 22, 2025
AlexV525

AlexV525 commented on May 22, 2025

@AlexV525
Author

@MichaelVerdon

I meant a full code example or a repo showing how you implemented it.

Sorry, but below (as previously said) was basically all necessary code:

Reproducing the issue

  1. Start the authentication flow with the TwitterAuthProvider.
  2. Authorized, and returning the app.
  3. After a few seconds, the app crashes.

The pseudo code I was calling:

Future _startAuth() async {
final provider = TwitterAuthProvider();
provider.setCustomParameters({
'scopes': 'users.read offline.access',
'lang': 'en',
});
final credential = await _$.signInWithProvider(provider);
final idToken = await credential.user?.getIdToken();
if (idToken == null) {
return;
}
// Making HTTP requests with idToken.
}

Setup the provider, call authorization, and get the idToken.


Do you also know what devices these users were using?

As previously described:

Detailed information can be found in the log file.

Hardware Model: iPhone 14 (iPhone14,7) OS Version: iPhone OS 16.7 (20H19)

crashlog_for_github.log

14 remaining items

Loading
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    blocked: customer-responseWaiting for customer response, e.g. more information was requested.platform: iosIssues / PRs which are specifically for iOS.plugin: authresolution: needs-reproThis issue could not be reproduced or needs an up to date reproduction on latest FlutterFire plugin.type: bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

      Development

      No branches or pull requests

        Participants

        @AlexV525@google-oss-bot@SelaseKay@MichaelVerdon

        Issue actions

          [firebase_auth]: Crash when returning to the app after authorized with X · Issue #17372 · firebase/flutterfire