Error: I am trying to log in with registered email and password but getting an error, firebase.auth.FirebaseAuthInvalidCredentialsException: The password is invalid or the user does not have a password.
Expected: To login with registered email and password
Solutions tried: Re-added google service json file
This is the logs:
03-14 11:24:54.378 16373-16373/com.jaytailor45.fbproject D/FirebaseApp: Notifying auth state listeners. 03-14 11:24:54.378 16373-16373/com.jaytailor45.fbproject D/FirebaseApp: Notified 0 auth state listeners. 03-14 11:25:08.585 16373-16373/com.jaytailor45.fbproject W/BiChannelGoogleApi: [FirebaseAuth: ] getGoogleApiForMethod() returned Gms: com.google.firebase.auth.api.internal.zzal@b8c5b14 03-14 11:25:09.414 16373-16373/com.jaytailor45.fbproject W/firebase: signInWithEmail:failure com.google.firebase.auth.FirebaseAuthInvalidCredentialsException: The password is invalid or the user does not have a password. at com.google.firebase.auth.api.internal.zzds.zzb(Unknown Source) at com.google.firebase.auth.api.internal.zzew.zza(Unknown Source) at com.google.firebase.auth.api.internal.zzeo.zzc(Unknown Source) at com.google.firebase.auth.api.internal.zzep.onFailure(Unknown Source) at com.google.firebase.auth.api.internal.zzdy.dispatchTransaction(Unknown Source) at com.google.android.gms.internal.firebase_auth.zzb.onTransact(Unknown Source) at android.os.Binder.execTransact(Binder.java:458) 03-14 11:27:14.167 16373-20522/com.jaytailor45.fbproject D/FA: Logging event (FE): user_engagement(_e), Bundle[{firebase_event_origin(_o)=auto, engagement_time_msec(_et)=139692, firebase_screen_class(_sc)=MainActivity, firebase_screen_id(_si)=-6317095346979771825}]
Code causing the error is given:
l_btn.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
final String email = l_email.getText().toString();
final String pass = l_pass.getText().toString();
mAuth.signInWithEmailAndPassword(email,pass)
.addOnCompleteListener(MainActivity.this, new OnCompleteListener<AuthResult>() {
@Override
public void onComplete(@NonNull Task<AuthResult> task) {
Toast.makeText(MainActivity.this,email + pass, Toast.LENGTH_SHORT).show();
if (task.isSuccessful()) {
Log.d("firebase", "signInWithEmail:success");
FirebaseUser user = mAuth.getCurrentUser();
startActivity(new Intent(getApplicationContext(),home.class));
finish();
} else {
Log.w("firebase", "signInWithEmail:failure", task.getException());
Toast.makeText(getApplicationContext(), "Authentication failed.",Toast.LENGTH_SHORT).show();
}
}
});
}
});
createUserWithEmailAndPasswordand then if user created successfully only then the user can signin - Santanu Sur