Flutter "[firebase_auth/operation-not-allowed]": Which Sign-In Provider Is Off and How to Turn It On

By · Published 2026-12-04 · Last verified 2026-12-04

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.

Grid of the 4-step Provider Match Check: find the method that threw, confirm the Firebase project, enable the provider in the Sign-in method tab, and retest without a rebuild
The 4-step Provider Match Check.

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.

  1. Find the method that threw. Log e.code and the call site in your FirebaseAuthException handler. createUserWithEmailAndPassword, signInAnonymously and signInWithCredential each map to a different provider.
  2. Confirm the Firebase project. Read the project ID from the app's firebase_options.dart (or google-services.json and GoogleService-Info.plist) and open that exact project in the console.
  3. 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.
  4. 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 threwWhat the FlutterFire reference saysProvider 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, signInWithEmailLinkFirebase'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.

Four-step map from FlutterFire method to provider: email and password to Email/Password, signInAnonymously to Anonymous, signInWithCredential to the credential's provider, and email link to Email/Password plus Email link
Which provider each method needs.

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.

Two columns of reasons the error continues after enabling a provider: the wrong dev or prod project, and a missing switch such as the email link toggle, the Google provider or a reached Auth quota
Why it can still fail.

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

Vertical Pinterest graphic with five points on fixing firebase_auth operation-not-allowed in Flutter
Pinterest pin: operation-not-allowed in Flutter.