Skip to content

Google sign-in without firebase #36673

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
omarbelkhodja opened this issue Jul 22, 2019 · 19 comments
Open

Google sign-in without firebase #36673

omarbelkhodja opened this issue Jul 22, 2019 · 19 comments
Labels
customer: crowd Affects or could affect many people, though not necessarily a specific customer. d: examples Sample code and demos d: stackoverflow Good question for Stack Overflow p: google_sign_in The Google Sign-In plugin P2 Important issues not at the top of the work list package flutter/packages repository. See also p: labels. team-ecosystem Owned by Ecosystem team triaged-ecosystem Triaged by Ecosystem team

Comments

@omarbelkhodja
Copy link

In most of tutorials on the web, I can see that the plugin google_sign_in doesn't require firebase. In pub page, it is mentioned that the application must be registered in the following link :
https://developers.google.com/mobile/add?platform=android

That link is now redirecting to firebase's homepage. So my question is:
Is it still possible to Sign-in without firebase ? Where should I register the app in that case ?

@thehitechpanky

This comment has been minimized.

@mhrst
Copy link

mhrst commented Aug 12, 2019

For using google_sign_in with a plain Google Cloud project, here's what I'm doing:

  • From the GCP Console for your project, go to APIs & Services > Credentials (https://console.cloud.google.com/apis/credentials)
  • Click the Create Credentials button, select OAuth Client ID
  • On the next screen, select Android as the Application Type
  • Fill in Signing-certificate fingerprint
  • Fill in Package name

It seems like creating a Firebase app takes care of this step for you (and does a bunch of other things to your GCP project as well), but it's the only thing required for basic login as far as I can tell.

@thehitechpanky
Copy link

This method does not give idtoken

@novembrea
Copy link

It does, you need to make sure to register both SHA-1 and SHA-256 keys in project settings.

@BondarenkoStas
Copy link

@omarbelkhodja Is the issue still relevant after comments above?

@BondarenkoStas BondarenkoStas added the waiting for customer response The Flutter team cannot make further progress on this issue until the original reporter responds label Sep 23, 2019
@iapicca iapicca added d: examples Sample code and demos d: stackoverflow Good question for Stack Overflow p: first party p: google_sign_in The Google Sign-In plugin customer: crowd Affects or could affect many people, though not necessarily a specific customer. and removed waiting for customer response The Flutter team cannot make further progress on this issue until the original reporter responds labels Nov 11, 2019
@anoop-ananthan
Copy link

Yes, this is a big problem. There don't seem to be any documentation except #36673 (comment). Thanks @truthmast

@christophemacabiau

This comment was marked as off-topic.

@TahaTesser
Copy link
Member

From #73455 by @avioli
#73455 (comment) should be documented to avoid running into issues

@aacassandra
Copy link

works fine for android and not for ios. i spend a lot of time on ios regarding google login without firebase

@tiagocdr
Copy link

tiagocdr commented Dec 3, 2021

Any Solutions for IOS ? Every solution I have found has been only for android

@toan-ngvan
Copy link

I find the solution. Just download the .plist file from gg cloud, rename the file to GoogleService-Info.plist and put it in Runner.

@simpros

This comment was marked as off-topic.

@zzundalek
Copy link

zzundalek commented May 1, 2022

Please at least clarify it.

  • Is firebase required for google_sign_in to work on iOS?
  • If yes add it to plugin description if no add working example without firebase

Thanks a lot.

@mhrst
Copy link

mhrst commented May 6, 2022

Updating my instructions from a previous comment to include steps for setting up iOS

For using google_sign_in with a plain Google Cloud project (no Firebase required), here's what I'm doing:

Android

iOS

  • From the GCP Console for your project, go to APIs & Services > Credentials (https://console.cloud.google.com/apis/credentials)
  • Click the Create Credentials button, select OAuth Client ID
  • On the next screen, select iOS as the Application Type
  • Fill in Bundle ID
  • After clicking Create a dialog will open with a DOWNLOAD PLIST button -- Grab this file and rename it to GoogleService-Info.plist
  • Open Xcode and put this plist file into the Runner folder

engine-flutter-autoroll added a commit to engine-flutter-autoroll/flutter that referenced this issue Nov 7, 2022
@flutter-triage-bot flutter-triage-bot bot added the package flutter/packages repository. See also p: labels. label Jul 5, 2023
@Hixie Hixie removed the plugin label Jul 6, 2023
@flutter-triage-bot flutter-triage-bot bot added team-ecosystem Owned by Ecosystem team triaged-ecosystem Triaged by Ecosystem team labels Jul 8, 2023
@anqit
Copy link

anqit commented Aug 25, 2024

Everything online says google_sign_in can be used on android without having to explicitly set the client_id when instantiating the GoogleSignIn instance. When I was using firebase, this worked fine. Now, I'm trying without firebase and am not able to get an id_token unless not only I do specify the client_id but also make sure to not use the android one I created but use the web one instead. Is this because I have misconfigured something or is this expected behavior? I definitely must echo the sentiment that documentation for this basic functionality seems to be sorely lacking.

@wildsylvan
Copy link

wildsylvan commented Aug 26, 2024

same as @anqit

here #20903 are some workarounds

@jaybe78
Copy link

jaybe78 commented Oct 2, 2024

I followed this documentation https://medium.com/codebrew/flutter-google-sign-in-without-firebase-3680713966fb
Since I've changed classpath 'com.google.gms:google-services:4.3.15'
I'm getting the following issue
requires google-services.json file where that is coming from firebase

this is quite confusing because that issue mentioned by different people is always related to firebase

takeny1998 added a commit to takeny1998/yeohaeng-ttukttak-v2 that referenced this issue Nov 26, 2024
번들 ID 변경
- 애플리케이션 번들 ID를 `com.yeohaeng_ttukttak.application`으로 변경하였음

> https://velog.io/@mouse0429/Flutter%EC%95%88%EB%93%9C%EB%A1%9C%EC%9D%B4%EB%93%9C-%ED%8C%A8%ED%82%A4%EC%A7%80%EB%AA%85-iOS-%EC%8B%9D%EB%B3%84%EC%9E%90%EB%AA%85-%EB%B3%80%EA%B2%BD%ED%95%98%EA%B8%B0

`google_sign_in` 패키지 마이그레이션
- 직접 코드에 클라이언트 ID를 제공하고, 앱 번들 ID를 Google Cloud Console에 등록하였음

> https://medium.com/codebrew/flutter-google-sign-in-without-firebase-3680713966fb
> flutter/flutter#36673 (comment)

`flutter_secure_storage` 마이그레이션
- 안드로이드 버전에 맞게 `9.2.2` 버전으로 업그레이드함

> juliansteenbakker/flutter_secure_storage#723
@nevsnirG
Copy link

Updating my instructions from a previous comment to include steps for setting up iOS

For using google_sign_in with a plain Google Cloud project (no Firebase required), here's what I'm doing:

Android

* From the GCP Console for your project, go to **APIs & Services** > **Credentials** (https://console.cloud.google.com/apis/credentials)

* Click the **Create Credentials** button, select **OAuth Client ID**

* On the next screen, select **Android** as the Application Type

* Fill in **Signing-certificate fingerprint**
  
  * For instructions on finding your signing-certificate fingerprint, https://developers.google.com/android/guides/client-auth)

* Fill in **Package name**

iOS

* From the GCP Console for your project, go to **APIs & Services** > **Credentials** (https://console.cloud.google.com/apis/credentials)

* Click the **Create Credentials** button, select **OAuth Client ID**

* On the next screen, select **iOS** as the Application Type

* Fill in **Bundle ID**

* After clicking **Create** a dialog will open with a **DOWNLOAD PLIST** button -- Grab this file and rename it to `GoogleService-Info.plist`

* Open Xcode and put this plist file into the `Runner` folder

Sadly I still get this error:
[_handleGoogleLogin] Google login failed: Exception: Failed to login with Google: PlatformException(sign_in_failed, com.google.android.gms.common.api.ApiException: 10: , null, null)
Exception: Failed to login with Google: PlatformException(sign_in_failed, com.google.android.gms.common.api.ApiException: 10: , ...

I verified the SHA-1 hash a million times. Generated a new keystore and tried that. Package name matches in the build.gradle and AndroidManifest too. Tried making new Android credentials in the Google Console. Still nothing unfortunately.

@Dzivo
Copy link

Dzivo commented May 16, 2025

Having the same problem even with firebase i have flavors setup so something can be an issue there. Really anoying errors dont say whats wrong. Shouldnt this be fixed asap ? This is like breaking of the breakings bug

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
customer: crowd Affects or could affect many people, though not necessarily a specific customer. d: examples Sample code and demos d: stackoverflow Good question for Stack Overflow p: google_sign_in The Google Sign-In plugin P2 Important issues not at the top of the work list package flutter/packages repository. See also p: labels. team-ecosystem Owned by Ecosystem team triaged-ecosystem Triaged by Ecosystem team
Projects
None yet
Development

No branches or pull requests