Firebase Auth and Google Calendar

后端 未结 2 328
日久生厌
日久生厌 2021-01-03 04:43

What I am trying to do is use Firebase to authenticate with Google. Then get some data from Google Calendar.

I got the first part working. I can authenticate with G

相关标签:
2条回答
  • 2021-01-03 05:21

    At present, Firebase only supports scopes listed here. Thus, you can't use the calendar* scopes to authenticate with Firebase auth.

    The only real workaround here, to avoid authenticating separately against Google and Firebase, would be to manually authenticate against Google with the requested scopes, then pass that OAuth token into Firebase's authWithOAuthToken method.

    In other words, reverse the auth process to log in with Google and then re-use the token in Firebase.

    0 讨论(0)
  • 2021-01-03 05:25

    I got it to work like this. I am just not sure how to use the information, but I got the auth part to work. Hope that it will help someone.

     Auth.$authWithOAuthPopup('google', {
                    remember: "default",
                    scope: 'https://www.googleapis.com/auth/calendar',
                    scope: 'email'
                })
                .then(function (authData) {
    
    0 讨论(0)
提交回复
热议问题