Sign In With Popup

Use the signInWithPopup method to link a new OAuth credential (e.g., Google, Facebook) to the existing user account using a popup window.

You can sign in users of your application using different authentication providers like Google, Facebook, GitHub etc.

circle-info

Ensure that your OAuth provider option has been enabled in your Firebase project.

Method

final userCredential = await FirebaseApp.firebaseAuth?.signInWithPopup(providerId);

Parameters

  • providerId (String): The OAuth provider ID (e.g., 'google.com', 'facebook.com') to link to the user's account.

Return

  • UserCredential?: Returns a UserCredential object containing the user's sign-in information.

This method opens a popup window to authenticate with the specified OAuth provider and links the new credential to the existing user account.

circle-info

You will still need to implement the OAuth flow, which typically involves opening a popup window or redirecting the user to the provider's login page.

Last updated