Firebase-js-sdk: Firebase login with google much slower than native google login, JWT takes a long time

Created on 16 Sep 2019  路  3Comments  路  Source: firebase/firebase-js-sdk

Describe your environment

  • Operating System version: OSX
  • Browser version: chrome 76.0.3809.132
  • Firebase SDK version: 6.4.1
  • Firebase Product: auth

I've noticed that following the login with google guide as mentioned in the firebase docs is significantly slower to load the actual google login page than using the login with google and then passing the creds to firebase

ezgif com-resize

Notice that the firebase popup shows about:blank for a good 2 seconds.

I've made a minimal reproduction to demonstrate this, (i'm using angular but it doesn't matter)
https://itsteknas.github.io/fierbase-login-delay-reproduction/

This bug is for two reasons,

  1. The time it takes to load the google login in firebase is too much compared to gauth ~3-4s
  2. The time it takes to get the firebase JWT after successful gauth is again too much ~2 s

The problem is only worsened by the poor connectivity while using cellular network.
You can try the demo page with some network throttling and see it for yourself.

auth

Most helpful comment

Hi all, thanks for the report! This is something definitely on our radar and we're planning to improve the startup speed. With that being said, it's definitely an involved project with many moving pieces.

In the meantime, the workaround suggested by @itsTeknas does work -- in that you can call Google Signin SDK and handle the flow manually. We know this is not ideal, but it should serve as a stop-gap measure.

All 3 comments

Sorry for the typo in the url 馃槄

@bojeil-google I noticed that you closed https://github.com/firebase/firebaseui-web/issues/436 earlier, but this issue still persists. I am seeing very slow (>3 second) about:blank times from New York City.

Hi all, thanks for the report! This is something definitely on our radar and we're planning to improve the startup speed. With that being said, it's definitely an involved project with many moving pieces.

In the meantime, the workaround suggested by @itsTeknas does work -- in that you can call Google Signin SDK and handle the flow manually. We know this is not ideal, but it should serve as a stop-gap measure.

Was this page helpful?
0 / 5 - 0 ratings