Firebase Google登录两个客户端

时间:2015-09-22 05:29:53

标签: android firebase firebase-security firebase-authentication

我需要使用Android客户端和Web客户端登录到同一个firebase应用程序。我怎么能这样做?

从文档中,我了解到我们需要创建Android类型的Google OAuth客户端ID,而对于Web客户端,我们需要创建Web应用类型类型的Google OAuth客户端ID。一旦我们创建了这两种不同类型的ID,我注意到在Firebase App Dashboard - Google的登录和验证屏幕中,我们只能提到一个密钥。

我该如何处理这种情况?

1 个答案:

答案 0 :(得分:0)

使用authWithOAuthToken方法解决了Web客户端的问题。

ref.authWithOAuthToken("google", "<ACCESS-TOKEN>", function(error, authData) {
  if (error) {
    console.log("Login Failed!", error);
  } else {
    console.log("Authenticated successfully with payload:", authData);
  }
});