Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/android/203.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Android Firebase Google登录两个客户端_Android_Firebase_Firebase Security_Firebase Authentication - Fatal编程技术网

Android Firebase Google登录两个客户端

Android Firebase Google登录两个客户端,android,firebase,firebase-security,firebase-authentication,Android,Firebase,Firebase Security,Firebase Authentication,我需要使用android客户端和web客户端登录到相同的firebase应用程序。我该怎么做 从文档中,我了解到我们需要创建android类型的google OAuth客户端ID,对于web客户端,我们需要创建web应用程序类型的google OAuth客户端ID。一旦我们创建这两种不同类型的ID,我注意到在Firebase应用程序仪表板-google的登录和身份验证屏幕中,我们只能提到一个键 如何处理这种情况?使用authWithOAuthToken方法解决了web客户端的问题 ref.aut

我需要使用android客户端和web客户端登录到相同的firebase应用程序。我该怎么做

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


如何处理这种情况?

使用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);
  }
});
ref.authWithOAuthToken(“谷歌”,函数(错误,authData){
如果(错误){
log(“登录失败!”,错误);
}否则{
log(“使用有效负载成功进行身份验证:”,authData);
}
});