8
votes

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!!

4
The most likely cause is that the code is authenticating against a different project than the one where you enabled email+password authentication. - Frank van Puffelen

4 Answers

6
votes

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!

3
votes

In my case, I forgot enable Auth Facebook in firebase console.

0
votes

I believe you may be using an older Firebase SDK. If you are using cocoa pods, add the following to your Podfile.

pod 'Firebase/Core'
pod 'Firebase/Database'
pod 'Firebase/Auth'
pod 'Fabric'

After you add the pods, in your terminal type:

pod update 

Click here for more explanation

Click this link for setup and to get the latest sdk

Also make sure you have GoogleService-info.plist in your project folder.

0
votes

in my case I had to create an app in Firebase project. Go to settings -> Project Settings -> 'Your Apps' or something like that -> create an app (choose from Android, iOS, Web, etc.), copy all the configs and you got it. Btw, I had a web project.