0

我需要使用Android客户端和Web客户端登录到相同的Firebase应用程序。我怎样才能做到这一点?Firebase谷歌登录两个客户端

从文档中,我了解我们需要创建android类型的Google OAuth客户端ID,而对于Web客户端,我们需要创建Web Applictaion类型的Google OAuth客户端ID。一旦我们创建了这两种不同类型的ID,我注意到在Firebase应用程序面板 - Google的登录和身份验证屏幕中,我们只能提到一个键。

我该如何处理这种情况?

回答

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