google Calendar api v3 Auth only for first time

2019-09-03 08:05发布

问题:

My application have social media authentication by using google+ and facebook. application use google calendar. From application user can add, edit, delete the events. So when user login with google+ there is no problem But when user login with facebook the user need to login with google+ for calendar interaction but i want user to be authenticated for google+ only at once i.e for the first time.Next time when user logs in with facebook he should not need to login with google+ for add,edit, delete calendar. How can I implement this?

回答1:

You should safely store the refresh token that you get when the user first grants access to your app. Afterwards you can use this refresh tokens to obtain new tokens any time if the previous Oauth tokens have expired.

https://developers.google.com/accounts/docs/OAuth2