我无法使用电子邮件&登录;使用Firebase身份验证的密码 [英] I can't login with Email & Password using Firebase Authentication

查看:50
本文介绍了我无法使用电子邮件&登录;使用Firebase身份验证的密码的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我遇到问题,当我尝试通过Firebase身份验证使用电子邮件/密码登录时.我已经在登录方式"标签中启用了电子邮件/密码.但是,只要我在同一个应用程序中注册,它就会允许我并在Firebase控制台用户列表中插入记录,但是当我尝试使用已注册的电子邮件&登录时,密码我无法前进,并且异常消息是:

I am facing problem, When I try to login with email/password via Firebase Authentication. 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:

密码无效或用户没有密码.

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();

                                }


                            }
                        });

推荐答案

例如当用户SomeUser向电子邮件some_user@gmail.com和任何密码注册时,可能是这种情况.然后,他使用同一电子邮件的Google帐户登录,然后尝试使用其Google帐户的电子邮件再次登录.在这种情况下,在用户将其Firebase帐户链接到google帐户后,google会删除密码.此处一些详细信息

This may be when for example user SomeUser registered with email some_user@gmail.com and any password. 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. Here are some details

这篇关于我无法使用电子邮件&amp;登录;使用Firebase身份验证的密码的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆