如何将Google Sign与电子邮件和密码身份验证链接到Android

时间:2019-02-06 17:21:44

标签: android firebase-authentication

我在Firebase教程中找不到足够的数据,以了解如何将Google Sign与Android的电子邮件和密码身份验证相关联。我需要先与Google签名,然后再使用电子邮件和密码登录

2 个答案:

答案 0 :(得分:1)

如果您要使用Firebase使用Google身份验证登录,则可以选中https://firebase.google.com/docs/auth/android/google-signin

如果您想使用电子邮件和密码功能登录,则可以选中https://firebase.google.com/docs/auth/android/password-auth

答案 1 :(得分:0)

如果您想向使用Google登录的现有Firebase用户添加密码,只需在currentUser上调用updatePassword

如果要将Google凭据链接到电子邮件/密码用户,只需使用currentUser上的Google AuthCredential调用linkWithCredential

之后,您应该可以使用任何一个凭据登录用户。