简体   繁体   English

我如何使用电子邮件身份验证的详细信息登录Firebase

[英]How can i login to Firebase using the details of email authentication

How can i use the details of the firebase email authentication sign in instead of me using the email and password i added myself.. 我如何使用Firebase电子邮件身份验证的详细信息登录,而不是使用添加的电子邮件和密码登录。

   private void loginToFirebase() {
    String email = getString(R.string.firebase_email);
    String password = getString(R.string.firebase_password);
    // Authenticate with Firebase and subscribe to updates
    FirebaseAuth.getInstance().signInWithEmailAndPassword(
            email, password).addOnCompleteListener(new OnCompleteListener<AuthResult>() {
        @Override
        public void onComplete(Task<AuthResult> task) {
            if (task.isSuccessful()) {
                subscribeToUpdates();
                Log.d(TAG, "firebase auth success");
            } else {
                Log.d(TAG, "firebase auth failed");
            }
        }
    });
} 

Like the Firebase documentation said : 就像Firebase文档所说:

FirebaseUser user = FirebaseAuth.getInstance().getCurrentUser();
if (user != null) {
// User is signed in
} else {
// No user is signed in
}

Here is the Firebase documentation 这是Firebase文档

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 我无法使用 Firebase 身份验证使用电子邮件和密码登录 - I can't login with Email & Password using Firebase Authentication 如何将 Firebase 电话身份验证与电子邮件/密码身份验证联系起来? - How Can I Link Firebase Phone Authentication with Email/Password Authentication? 如何限制Firebase电子邮件登录中的错误密码尝试? - How can i limit the wrong password attempts in Firebase email login? Firebase电子邮件身份验证将用户名和详细信息添加到Firebase数据库 - Firebase email authentication add username and details to firebase database 我有一个问题,如果我使用 firebase facebook 登录如何获取用户名或 email? - I have a question, if I used firebase facebook login how can get username or email? 使用Firebase的登录身份验证失败 - Login authentication using Firebase unsuccessful Firebase 使用 UID 获取身份验证详细信息 - Firebase get Authentication details using UID 如何在Firebase身份验证中更新用户的详细信息 - How to update the details of the user in Firebase Authentication 如何使用firebase身份验证创建用户名,地址和详细信息 - how to create username , address and details with firebase authentication 如何确定 Firebase 用户是否使用电子邮件和密码身份验证登录 - How to determine if a Firebase user is signed in using email and password authentication
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM