0

Is it possible to use Firebase Authentication, to authenticate my iOS/Web/Android users to my platform, and then for each user to create a google calendar and sync them with the rest of the users through Firebase?

This is the first time that I'm dealing with something like this and I'm honestly confused, the documentation on the API's hasn't helped me thus far.

ProToCooL
  • 177
  • 1
  • 3
  • 13

1 Answers1

0

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.

Teyam
  • 7,686
  • 3
  • 15
  • 22