Flutter "[firebase_auth/operation-not-allowed]": Which Sign-In Provider Is Off and How to Turn It On
What does "[firebase_auth/operation-not-allowed]" mean in Flutter?
It means the sign-in method your Flutter code just called is switched off for the Firebase project the app is connected to. Firebase Authentication rejects the call before it checks the email, password or token. The Firebase Auth SDK maps the operation-not-allowed code to "The given sign-in provider is disabled for this Firebase project. Enable it in the Firebase console, under the sign-in method tab of the Auth section." The fix is almost never in Dart: open the right project in the Firebase console, go to Security > Authentication > Sign-in method, and enable the provider that matches the method that threw. This guide was checked against the FlutterFire API reference and Firebase docs on 2026-12-04.
The Provider Match Check: 4 steps
Short answer: match the method that threw to its provider, confirm you are looking at the same project the app uses, enable it, and test again.
- Find the method that threw. Log
e.codeand the call site in yourFirebaseAuthExceptionhandler.createUserWithEmailAndPassword,signInAnonymouslyandsignInWithCredentialeach map to a different provider. - Confirm the Firebase project. Read the project ID from the app's
firebase_options.dart(orgoogle-services.jsonandGoogleService-Info.plist) and open that exact project in the console. - Enable the matching provider. In Security > Authentication > Sign-in method, enable it and click Save. Federated providers also need their own setup, such as the SHA-1 key for Google on Android.
- Test the same flow again. No rebuild is needed for a console change; run the same sign-in call and confirm the error is gone.
Which provider does each FlutterFire method need?
Short answer: the FlutterFire reference lists operation-not-allowed on each sign-in method and names the account type you have to enable.
| Method that threw | What the FlutterFire reference says | Provider to enable |
|---|---|---|
createUserWithEmailAndPassword, signInWithEmailAndPassword | "Thrown if email/password accounts are not enabled." | Email/Password |
signInAnonymously | "Thrown if anonymous accounts are not enabled." | Anonymous |
signInWithCredential (Google, Apple, Facebook, phone credentials) | "Thrown if the type of account corresponding to the credential is not enabled." | The provider that issued the credential |
sendSignInLinkToEmail, signInWithEmailLink | Firebase's email-link guide: "email/password sign-in must be enabled to use email link sign-in." | Email/Password plus Email link (passwordless sign-in) |
Last checked: 2026-12-04 on pub.dev's firebase_auth API reference and Firebase's Flutter guides.
Why does it still fail after I enabled the provider?
Short answer: usually because the app talks to a different Firebase project than the one you changed, or because a second switch was left off.
- Dev and prod projects. Sign-in providers are set per project. If you build flavors against separate projects, each one needs the provider enabled. Compare the
projectIdin the generated options file with the console URL. - Email link needs both switches. Enabling Email/Password alone is not enough for passwordless links; the Email link option sits in the same provider panel and has to be turned on too.
- The credential's provider is off. A Google credential passed to
signInWithCredentialfails if the Google provider is disabled, even when Email/Password is on. - A different error is hiding behind it. The FlutterFire error-handling guide notes that errors "such as too-many-requests or operation-not-allowed may be thrown if you reach the Firebase Authentication quota", so check the console's usage and limits too. Our too-many-requests guide covers the quota side.
When does operation-not-allowed usually show up after launch?
Short answer: when an app update ships a new sign-in option that was only switched on in the development project.
The common pattern is a release that adds a "Continue with Google" button, a guest mode built on anonymous sign-in, or passwordless email links. The code is tested against a dev project where the provider is on, and the production project never got the same switch. Firebase's Flutter guides say this for each provider: Google sign-in needs the "Google" sign-in provider enabled, and Play Games sign-in needs the "Play Games" provider enabled, both in the Sign-in method tab. Add one line per provider to your release notes or checklist ("enabled in prod: yes or no") and the error never reaches users. Crashlytics or your own logs will show the exact method name if one slips through.
How should the app handle the error for users?
Short answer: treat operation-not-allowed as a configuration bug, not a user mistake, and never ask the user to try again.
A user cannot fix a disabled provider, so show a short "this sign-in option is unavailable right now" message, log the code with the method name to Crashlytics or your logs, and offer another enabled sign-in option if you have one. Keep it out of the "wrong password" branch: invalid-credential and wrong-password errors are user-fixable, and account-exists-with-different-credential needs account linking, not a console switch.
try {
await FirebaseAuth.instance.signInAnonymously();
} on FirebaseAuthException catch (e) {
if (e.code == 'operation-not-allowed') {
// Config bug: provider disabled in this Firebase project.
log('Auth provider disabled for signInAnonymously');
showMessage('This sign-in option is unavailable right now.');
}
}
Is it safe to leave unused providers enabled?
Short answer: enable only the providers your app really uses, because each enabled method is another way to create accounts in your project.
Anonymous sign-in is the one most often turned on for a quick test and then forgotten. If your app does not use it, leave it disabled and handle operation-not-allowed as above. For other ways to limit abuse of a public Firebase config, see the Firebase Auth API key abuse hardening checklist, and run the Flutter and Firebase release checklist for Google Play before each release so a provider switched on in dev is also on in prod.
GSPTeck is giosaia's indie studio building mobile and web apps with Flutter and Firebase; the apps are listed on the GSPTeck homepage.
FAQ
Do I need to rebuild the Flutter app after enabling a provider?
No. Sign-in providers are a project setting in the Firebase console, so the change applies to the next sign-in call. Rebuild only if you also changed the Firebase options file.
Why does email/password work but email link sign-in throws operation-not-allowed?
Email link sign-in has its own switch. Firebase's guide says email/password sign-in must be enabled to use email link sign-in, and the Email link (passwordless sign-in) option must be enabled as well.
Can operation-not-allowed come from Google Sign-In?
Yes. signInWithCredential throws it when the provider behind the credential, such as Google, is not enabled in the project. Enable Google in the Sign-in method tab.
Is operation-not-allowed the user's fault?
No. It is a project configuration problem. Show a neutral message, log the code, and fix the provider setting in the Firebase console.
Sources
- pub.dev: createUserWithEmailAndPassword error codes (checked 2026-12-04)
- pub.dev: signInAnonymously error codes (checked 2026-12-04)
- pub.dev: signInWithCredential error codes (checked 2026-12-04)
- Firebase: Email link authentication in Flutter (checked 2026-12-04)
- Firebase: Anonymous authentication in Flutter (checked 2026-12-04)
- Firebase: Federated sign-in in Flutter (Google, Play Games providers) (checked 2026-12-04)
- Firebase: Error handling in Flutter Auth (checked 2026-12-04)