简体   繁体   English

具有Firebase和多个云项目的Android Google身份验证

[英]Android Google Authentication With Firebase And Multiple Cloud Projects

Is it possible to use Google Sign In with a web client id, that belongs to a different google cloud project than the one that is used for firebase? 是否可以将Google登录与网络客户端ID一起使用,该客户端ID与用于Firebase的Web客户端项目属于不同的Google云项目?

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.

相关问题 如何在Android Studio中的多个项目中重用Google Cloud端点 - How to reuse google cloud endpoints in multiple projects in android studio 在 Android 应用程序中使用多个 Firebase 项目进行 Google 登录 - Working with multiple Firebase projects in an Android app for Google sign-in 链接现有的Firebase和Google Cloud项目 - Link existing Firebase and Google Cloud projects 在同一个 Android 应用程序中使用多个 Firebase 项目的 Firebase 云消息传递的当前最佳实践是什么? - What is the current best practice for using Firebase Cloud Messaging with multiple Firebase projects in the same Android app? Firebase 多个项目和分析 Android - Firebase Multiple Projects & Analytics Android Firebase谷歌身份验证不能正常运行android - Firebase google authentication not working android Google Firebase身份验证Android Studio - Google Firebase Authentication Android Studio 使用google firebase身份验证对android进行身份验证 - Authenticating android with google firebase authentication 具有多个项目的 Firebase google-services.json? - Firebase google-services.json with multiple projects? Android 应用程序的 Firebase Cloud Functions 身份验证 - Firebase Cloud Functions authentication for Android App
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM