Skip to content

[firebase_auth]: signOut cannot sign out the Twitter Auth Provider #17337

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
1 task done
AlexV525 opened this issue May 7, 2025 · 7 comments
Open
1 task done

[firebase_auth]: signOut cannot sign out the Twitter Auth Provider #17337

AlexV525 opened this issue May 7, 2025 · 7 comments
Labels
blocked: firebase-sdk Needs Attention This issue needs maintainer attention. platform: android Issues / PRs which are specifically for Android. platform: ios Issues / PRs which are specifically for iOS. plugin: auth type: bug Something isn't working

Comments

@AlexV525
Copy link

AlexV525 commented May 7, 2025

Is there an existing issue for this?

  • I have searched the existing issues.

Which plugins are affected?

Auth

Which platforms are affected?

Android, iOS

Description

Calling FirebaseAuth.signOut cannot sign out of Twitter from the opening web tab; it still automatically redirects to the previous logged-in Twitter account.

Reproducing the issue

  1. Use TwitterAuthProvider to sign in.
  2. Call FirebaseAuth.instance.signOut.
  3. Reauth with TwitterAuthProvider.

Firebase Core version

3.13.0

Flutter Version

3.27.4

Relevant Log Output

No helpful information.

Flutter dependencies

pubspec.lock
  firebase_auth:
    version: "5.5.2"
  firebase_auth_platform_interface:
    version: "7.6.2"
  firebase_auth_web:
    version: "5.14.2"
  firebase_core:
    version: "3.13.0"
  firebase_core_platform_interface:
    version: "5.4.0"
  firebase_core_web:
    version: "2.22.0"

Additional context and comments

No response

@AlexV525 AlexV525 added type: bug Something isn't working Needs Attention This issue needs maintainer attention. labels May 7, 2025
@MichaelVerdon MichaelVerdon added plugin: auth platform: android Issues / PRs which are specifically for Android. platform: ios Issues / PRs which are specifically for iOS. labels May 7, 2025
@MichaelVerdon
Copy link
Contributor

Hey there, i have been unable to reproduce using our example application This leads me to suspect it might be an implementation issue on your end. I would like to ask you to please check out the example application and compare implementations. If it still does not work I am happy to take a look at your repo if you are able to share it. Perhaps you might not be awaiting the signout properly?

@MichaelVerdon MichaelVerdon added blocked: customer-response Waiting for customer response, e.g. more information was requested. and removed Needs Attention This issue needs maintainer attention. labels May 7, 2025
@AlexV525
Copy link
Author

AlexV525 commented May 7, 2025

@MichaelVerdon : Thanks for your reply. The example you are pointing to does not involve Twitter sign-in. Could you elaborate on your changes to make the example work with that provider?

Here are my code snippets with the package:

_$ equals FirebaseAuth.instance.

  static Future<UserCredential> signInWithX() async {
    final provider = TwitterAuthProvider();
    provider.setCustomParameters({
      'scopes': 'users.read offline.access',
      'lang': 'en',
    });
    final credential = await _$.signInWithProvider(provider);
    return credential;
  }

  static Future<void> logout() async {
    await _$.signOut();
  }

@google-oss-bot google-oss-bot added Needs Attention This issue needs maintainer attention. and removed blocked: customer-response Waiting for customer response, e.g. more information was requested. labels May 7, 2025
@MichaelVerdon
Copy link
Contributor

@MichaelVerdon : Thanks for your reply. The example you are pointing to does not involve Twitter sign-in. Could you elaborate on your changes to make the example work with that provider?

Hi there, the example does have Twitter sign in, here is the exact link to it. Hope this helps 😄

Future<void> _signInWithTwitter() async {

@MichaelVerdon MichaelVerdon added blocked: customer-response Waiting for customer response, e.g. more information was requested. and removed Needs Attention This issue needs maintainer attention. labels May 8, 2025
@AlexV525
Copy link
Author

AlexV525 commented May 9, 2025

Hi there, the example does have Twitter sign in, here is the exact link to it. Hope this helps 😄

@MichaelVerdon : Thanks for pointing it out.

I've tried the example with "Sign in with Twitter" and it reuses my authorization in other apps as it opens a system web tab and redirects directly. Calling signOut also reproduces the same behavior here.

JEF-AN00.2025-05-09.14-36-12.mp4

@google-oss-bot google-oss-bot added Needs Attention This issue needs maintainer attention. and removed blocked: customer-response Waiting for customer response, e.g. more information was requested. labels May 9, 2025
@MichaelVerdon
Copy link
Contributor

Hi there, thanks for the video I can confirm I am able to reproduce and must have misunderstood you before and I believe this is expected behaviour. Whilst sign out makes the firebase session end I don't think it makes the twitter session end. And I do not think this is something we can do on our side. I think the only way around it is to make a flow where you sign out of twitter in browser at the same time as signing out of auth together.

@MichaelVerdon MichaelVerdon added blocked: customer-response Waiting for customer response, e.g. more information was requested. and removed Needs Attention This issue needs maintainer attention. labels May 9, 2025
@AlexV525
Copy link
Author

AlexV525 commented May 9, 2025

It seems that the native library contains the related ability. firebase/FirebaseUI-Android#645

@google-oss-bot google-oss-bot added Needs Attention This issue needs maintainer attention. and removed blocked: customer-response Waiting for customer response, e.g. more information was requested. labels May 9, 2025
@MichaelVerdon
Copy link
Contributor

It seems that the native library contains the related ability. firebase/FirebaseUI-Android#645

I see, might be worth opening a ticket there and seeing what they say.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
blocked: firebase-sdk Needs Attention This issue needs maintainer attention. platform: android Issues / PRs which are specifically for Android. platform: ios Issues / PRs which are specifically for iOS. plugin: auth type: bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants