Add firebase_auth, enable a sign-in method in the Firebase console, then call one function per method: createUserWithEmailAndPassword for email sign-up, signInWithCredential after google_sign_in for Google, and signInWithProvider for Apple. Firebase keeps the user signed in and gives you a stable user id.
This guide is for Flutter developers building accounts, with firebase_auth 7.0.0 and google_sign_in 7.2.0 as of October 2026. The running example is a bakery app where customers sign in to see past orders.
In short:
- Switch on each provider in the Firebase console first, or calls fail.
- google_sign_in 7 needs
initialize()awaited once before anything else. - Apple's guideline 4.8: Google login needs an equal privacy-friendly option, such as Sign in with Apple.
- Apple's guideline 5.1.1(v) requires in-app account deletion.
Email and password needs five lines
Run flutter pub add firebase_auth after setting up Firebase. Then, from the password guide:
try {
await FirebaseAuth.instance.createUserWithEmailAndPassword(
email: email, password: password);
} on FirebaseAuthException catch (e) {
if (e.code == 'weak-password') { /* ask for a longer one */ }
}
signInWithEmailAndPassword has the same shape. Two extras help from day one: user.sendEmailVerification() and FirebaseAuth.instance.sendPasswordResetEmail(email: email).
Do not rely on specific sign-in error codes
The docs show user-not-found and wrong-password. But email enumeration protection, on by default for projects created from 15 September 2023, withholds those hints so attackers cannot probe which emails exist (Google Cloud docs). Write one message: "Email or password is wrong."
Listen to the auth stream
Let a stream drive your screens:
final authProvider = StreamProvider<User?>(
(ref) => FirebaseAuth.instance.authStateChanges(),
);
idTokenChanges() also fires on token refresh, and userChanges() on profile edits. On iOS and macOS, sign-in state can survive an uninstall, because the SDK keeps it in the keychain.
Google sign-in changed in version 7
On mobile, google_sign_in (publisher flutter.dev) is a separate package. Version 7 made it a singleton, so call initialize() once and await it. The rest is from the Firebase social sign-in page:
await GoogleSignIn.instance.initialize(); // once, at startup
final user = await GoogleSignIn.instance.authenticate();
final credential = GoogleAuthProvider.credential(
idToken: user.authentication.idToken);
await FirebaseAuth.instance.signInWithCredential(credential);
Tutorials that call GoogleSignIn().signIn() target version 6. On Android, also add your app's SHA-1 key in the console. On web, skip the package and call signInWithPopup(GoogleAuthProvider()).
Apple sign-in is one provider call
final apple = AppleAuthProvider();
if (kIsWeb) {
await FirebaseAuth.instance.signInWithPopup(apple);
} else {
await FirebaseAuth.instance.signInWithProvider(apple);
}
First configure Sign in with Apple in your Apple developer account, enable it in Firebase, and add the capability to the iOS Runner target. For the native sheet, the docs describe a route with the sign_in_with_apple package (8.2.0, publisher aboutyou.com) and a nonce.
Two Apple rules shape your choices
Both are in the App Store Review Guidelines:
- 4.8: an app that uses a third-party login such as Google to create the primary account must also offer an equivalent login that limits data to name and email, allows a private email, and does not track for ads without consent. Using only your own email-and-password system is an exception.
- 5.1.1(v): if users can create an account, they must be able to delete it in the app. In Flutter,
await user?.delete();deletes the Firebase Authentication account, but your deletion flow must also delete associated personal data unless retention is legally required and, for Sign in with Apple, revoke the user's Apple tokens. If Firebase answersrequires-recent-login, sign the user in again and callreauthenticateWithCredentialfirst.
Apple updates the guidelines, so read the current text before you submit.
Sign-in does not protect data by itself
Authentication tells you who the user is. Security rules decide what they may read. A login screen over open rules protects nothing.
Generated apps use email sign-in only
Apps built with GrowApps use Firebase Auth. Many generated apps need no accounts at all.
Generated apps share one managed Firebase project, so keep private data out until you add your own server-side checks. If you export the code to your own Firebase project, everything above applies. More at growapps.ai.
Test sign-up with a weak password
Create an account with the password 123. You should see a friendly message, not an exception. Then read how rules protect each user's data.
Frequently asked questions
Can one user have several sign-in methods?
Yes. Link them with linkWithCredential. The Firebase docs note that signing in with Google after registering the same email by hand changes the account's provider to Google.
Is anonymous sign-in useful?
It lets people try your app first with signInAnonymously(), and you can link a real credential later.
Sources and further reading
- Get started with Firebase Auth on Flutter
- Password authentication on Flutter
- Federated identity and social sign-in on Flutter
- Manage users on Flutter
- Anonymous authentication on Flutter
- Email enumeration protection (Google Cloud)
- firebase_auth on pub.dev
- google_sign_in on pub.dev
- App Store Review Guidelines
- Sign in with Apple