Skip to content

docs(auth): Update Google signInWithGoogle method to match 7.xx API #17498

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

Merged
merged 1 commit into from
Jul 8, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 3 additions & 6 deletions docs/auth/federated-auth.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,16 +37,13 @@ Ensure the "Google" sign-in provider is enabled on the [Firebase Console](https:

Future<UserCredential> signInWithGoogle() async {
// Trigger the authentication flow
final GoogleSignInAccount? googleUser = await GoogleSignIn().signIn();
final GoogleSignInAccount? googleUser = await GoogleSignIn.instance.authenticate();

// Obtain the auth details from the request
final GoogleSignInAuthentication? googleAuth = await googleUser?.authentication;
final GoogleSignInAuthentication googleAuth = googleUser.authentication;

// Create a new credential
final credential = GoogleAuthProvider.credential(
accessToken: googleAuth?.accessToken,
idToken: googleAuth?.idToken,
);
final credential = GoogleAuthProvider.credential(idToken: googleAuth.idToken);

// Once signed in, return the UserCredential
return await FirebaseAuth.instance.signInWithCredential(credential);
Expand Down