Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Firebase createUserWithEmailAndPassword does not work

I am following the basic tutorial in order to create an e-mail / password authentication using Firebase.

  mAuth.createUserWithEmailAndPassword(email, password)
            .addOnCompleteListener(this, new OnCompleteListener<AuthResult>() {
                @Override
                public void onComplete(@NonNull Task<AuthResult> task) {
                    Log.d(TAG, "createUserWithEmail:onComplete:" + task.isSuccessful());

                    if (!task.isSuccessful()) {
                        Toast.makeText(MainActivity.this, R.string.auth_failed,
                                Toast.LENGTH_SHORT).show();
                    }

                    hideProgressDialog();
                }
 });

But whenever I try to create an account (with a valid e-mail address and a diversity of passwords, with caps, numbers, high length) it displays my failure Toast.

What could I be doing wrong?


1 Answers

As this answer says: Firebase Android: An internal error has occurred. [ OPERATION_NOT_ALLOWED ]

You need to have the authentication method enabled in the Firebase console, so go to the authentication option on Firebase and then, to the sign in method to activate the email provider.

I Hope it helps!

like image 52
Jaco Avatar answered Aug 29 '26 07:08

Jaco