Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Firebase "sign in method is disabled" despite having enabled it

I am configuring my login page for my app, and trying to add a section where users can connect to firebase... Im trying to use firebase auth to sign up new users, but I get this error when running this code

 if (newRegistrationEmail.text != "" && newRegistrationUsername.text != "" && newRegistrationPassword.text != "" && newRegistrationRepeatedPassword.text != "")
 {
    FIRAuth.auth()?.createUser(withEmail: newRegistrationEmail.text!, password: newRegistrationPassword.text!, completion: 
    {
       user, error in

       if error != nil {
            print(error)
       }

The error:

Optional(Error Domain=FIRAuthErrorDomain Code=17006 "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." UserInfo={NSLocalizedDescription=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., error_name=ERROR_OPERATION_NOT_ALLOWED})

I've checked my Firebase console, and I have the email option enabled, so Im not sure why it won't let me use email in my code. Any ideas on how to fix it?? Thanks so much!!

like image 483
bbken99 Avatar asked Mar 11 '17 18:03

bbken99


People also ask

How do you check if a user has already exists in Firebase authentication?

If you want to check if a user already exists, then you have to save that information either in Firestore or in the Realtime Database, and then simply perform a query to check if a particular phone number already exists. Unfortunately, you cannot check that in the Firebase console.

How do I authenticate with Firebase?

You can sign in users to your Firebase app either by using FirebaseUI as a complete drop-in auth solution or by using the Firebase Authentication SDK to manually integrate one or several sign-in methods into your app. The recommended way to add a complete sign-in system to your app.

What does Firebase auth () CurrentUser return?

What does Firebase auth () CurrentUser return? If a user isn't signed in, CurrentUser returns null. Note: CurrentUser might also return null because the auth object has not finished initializing.


1 Answers

Just had the same issue. I was trying to add to an existing Firebase project, so I skipped all of the setup steps under the assumption that my project would just work because it was already enabled. Here's what worked for me:

  1. Delete the GoogleService-Info.plist file in your project folder.
  2. On Firebase, navigate to your project's Settings page.
  3. Re-download GoogleService-Info.plist
  4. Drag it into your project folder.

Hope this helps! This was a super frustrating error!

like image 77
Anna Dodson Avatar answered Oct 24 '22 20:10

Anna Dodson