You may want to check this thread wherein it was stated that:
There is no way to currently do this with the current SDKs that I am aware of, unless you roll your own Google OAuth flow using custom authentication.
Reading through it, one encountered problem is with the access_token
.
When login to Firebase using Google credentials, it gives you back the Google access_token
, which is great. Unfortunately, that token only last for an hour and you're NOT given a refresh token
, which means while your app is still authenticated against Firebase after an hour you can no longer access the Google APIs without forcing the user to login again.
As a workaround, you can try handling the authentication outside Firebase
using standalone Auth client which can be loaded with the JavaScript client's load
function:
<script src="https://apis.google.com/js/api.js" type="text/javascript"></script>
<script type="text/javascript">
gapi.load('auth2', init);
</script>
Then, manually handle the Firebase sign-in flow as discussed in this Firebase documentation.
Lastly, see this SO post for additional insights.