[英]I can't login with Email & Password using Firebase Authentication
I am facing problem, When I try to login with email/password via Firebase Authentication.我遇到了问题,当我尝试通过 Firebase 身份验证使用电子邮件/密码登录时。 I have already enable the email/password in SIGN-IN-METHOD tab.
我已经在登录方法选项卡中启用了电子邮件/密码。 But whenever I signup in the same app then it allow me and record inserted in Firebase console user list, but when I try to login with the registered email & password I can't move forward, and the exception message is:
但是每当我在同一个应用程序中注册时,它就会允许我将记录插入到 Firebase 控制台用户列表中,但是当我尝试使用注册的电子邮件和密码登录时,我无法继续,并且异常消息是:
The password is invalid or the user does not have a password.
密码无效或用户没有密码。
For Login, my code is :对于登录,我的代码是:
FirebaseAuth auth=FirebaseAuth.getInstance();
auth.signInWithEmailAndPassword(email, password)
.addOnCompleteListener(LoginActivity.this, new OnCompleteListener<AuthResult>() {
@Override
public void onComplete(@NonNull Task<AuthResult> task) {
pb.dismiss();
if (task.isSuccessful()) {
// Sign in success, update UI with the signed-in user's information
Intent intent = new Intent(LoginActivity.this, DrawerActivity.class);
startActivity(intent);
finish();
} else {
// If sign in fails, display a message to the user.
// Log.w("Tag", "Tag signInWithEmail:failure", task.getException());
Log.i("Tags", "Tags signInWithEmail:failure" + task.getException());
Toast.makeText(LoginActivity.this, "Authentication failed.",
Toast.LENGTH_SHORT).show();
}
}
});
This may be when for example user SomeUser registered with email some_user@gmail.com and any password.例如,这可能是当用户 SomeUser 使用电子邮件 some_user@gmail.com 和任何密码注册时。 Then he signed in with google account of the same email and then tries to log in again using email of his google account.
然后他使用同一电子邮件的谷歌帐户登录,然后尝试使用他的谷歌帐户的电子邮件再次登录。 In this case google removes password after user links his firebase account to google account.
在这种情况下,谷歌会在用户将他的 firebase 帐户链接到谷歌帐户后删除密码。 Here are some details
这里有一些细节
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.