[英]Android Google Authentication With Firebase And Multiple Cloud Projects
We have two cloud projects 我们有两个云项目
project-main
Used for most of our own infrastructure. 用于我们自己的大多数基础结构。
project-mobile
Used for firebase and mobile (android). 用于Firebase和移动设备(android)。
I'd like configure Google Sign In to use a web client id created for project-main
in order to authorize android clients using GoogleSignInOptions.Builder.requestIdToken(String) at our backend. 我想将Google登录配置为使用为project-main
创建的Web客户端ID,以便在我们的后端使用GoogleSignInOptions.Builder.requestIdToken(String)授权android客户端。 The app's gms Gradle plugin is pointing to project-mobile
by using the downloaded google-services.json
from firebase. 该应用程序的gms Gradle插件通过使用从firebase下载的google-services.json
指向了project-mobile
。 How can this be done? 如何才能做到这一点?
I found a post titled Working with multiple Firebase projects in an Android app . 我在Android应用程序中找到了标题为“处理多个Firebase项目 ”的帖子。 Unfortunately it did not solve the issue for me. 不幸的是,它没有为我解决问题。 The client fails to authorize at google. 客户端无法在Google授权。
PS: When using the default web client id, authorization works. PS:使用默认的Web客户端ID时,授权有效。 But this is not what I want - as the default client id is created for project-mobile
. 但这不是我想要的-因为默认客户端ID是为project-mobile
创建的。
通过从Firebase控制台配置中删除SHA指纹来解决此问题。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.