![](/img/trans.png)
[英]How can i login to Firebase using the details of email authentication
[英]I can't login with Email & Password using Firebase Authentication
我遇到了问题,当我尝试通过 Firebase 身份验证使用电子邮件/密码登录时。 我已经在登录方法选项卡中启用了电子邮件/密码。 但是每当我在同一个应用程序中注册时,它就会允许我将记录插入到 Firebase 控制台用户列表中,但是当我尝试使用注册的电子邮件和密码登录时,我无法继续,并且异常消息是:
密码无效或用户没有密码。
对于登录,我的代码是:
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();
}
}
});
例如,这可能是当用户 SomeUser 使用电子邮件 some_user@gmail.com 和任何密码注册时。 然后他使用同一电子邮件的谷歌帐户登录,然后尝试使用他的谷歌帐户的电子邮件再次登录。 在这种情况下,谷歌会在用户将他的 firebase 帐户链接到谷歌帐户后删除密码。 这里有一些细节
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.