Recent breakage of google-sign-in with flutter on Chrome?

424

Aha! The culprit here was blocking of third party cookies. If I turn off third party cookie blocking, things work fine.

Yikes, this makes using Google-sign-in unusable for webapps whose customers are blocking third party cookies.

Share:
424
Klapaucius Klapaucius
Author by

Klapaucius Klapaucius

Updated on December 21, 2022

Comments

  • Klapaucius Klapaucius
    Klapaucius Klapaucius 11 months

    As of 1 day ago, I seem to have trouble with google sign in running inside a flutter app on firebase.

    When loading the webapp, I see an exception with obfuscated stack traces:

    Uncaught TypeError: t.gpT is not a function
        at Im.$1 (google_sign_in_web.dart:113)
        at Object.a4P (js_helper.dart:1060)
        at Object.Yq (core_patch.dart:84)
        at a6F (js_patch.dart:541)
        at js_patch.dart:519
        at e.zo (cb=gapi.loaded_0:200)
        at lk (cb=gapi.loaded_0:203)
        at gk (cb=gapi.loaded_0:203)
        at _.Rj.hU (cb=gapi.loaded_0:203)
        at Qj (cb=gapi.loaded_0:195)
    

    This happens when deploying on firebase and on Chrome, not when running on localhost (same chrome), or when using the firebase deployment on Safari.

    I'm properly stumped - I don't remember having upgraded the browser or changing anything in the code. Neither do I remember having fiddled with the oauth tokens.

    Any ideas how to properly debug this ? I'm fairly inexperienced in dart/firebase/JS.

    [Update]: I found that I can reproduce this even with the Google provided example at:

    https://github.com/flutter/plugins/tree/master/packages/google_sign_in/google_sign_in/example
    

    This works when I run it with flutter run -d chrome or flutter run -s web-server

    When I do a firebase deploy, the app runs fine in Safari. In Chrome I get above exception. I tried to disable all extensions, same thing.

    • helloWorld
      helloWorld over 3 years
      Exact same issue. Deployed on Firebase, works perfectly on Safari. Doesn't even show a pop-up on Chrome. Allowed all cookies, still the same.
  • Klapaucius Klapaucius
    Klapaucius Klapaucius over 3 years
    And this is also true when trying to use the firebase equivalent described in https://github.com/funwithflutter/tutorials/tree/master/001-‌​Flutter-Web-Firebase‌​-Auth-Google - third party cookies must be allowed :(
  • helloWorld
    helloWorld over 3 years
    I have allowed all cookies in my Chrome. Still the same issue. Works fine on Safari
  • Klapaucius Klapaucius
    Klapaucius Klapaucius over 3 years
    Are you sure you're having no chrome extensions set ? There may also be problems with same-site cookies (overridden via Chrome flags). The sign-in library seems fairly troubled, I just switched to usernames and passwords, for which firebase has support. Does your console give any useful errors other than this one?