We are working on an app with Google Calendar Integration for Google marketplace users. Many of the links in the documentation https://developers.google.com/google-apps/marketplace/best_practices is not working. Can anybody point me to work in 2-Legged OAuth with RESTful Google Calendar API V3 for marketplace users? TIA, Riyaz .A
Asked
Active
Viewed 162 times
0
-
See: http://stackoverflow.com/questions/17020076/admin-sdk-and-2-legged-oauth/17023358#17023358 it refers to the Admin SDK API but the process would be the same for Calendar v3. – Jay Lee Jun 18 '13 at 15:12
-
We have released a new experience for the Google Apps Marketplace ([see announcement](http://googleenterprise.blogspot.com/2013/11/third-party-apps-now-easier-to-find-and.html)). You can read details in our [Developer Documentation](https://developers.google.com/apps-marketplace/). In the new experience, we have moved away from 2-legged OAuth. You should use [Service Accounts](https://developers.google.com/accounts/docs/OAuth2ServiceAccount). There is good documentation for [Drive](https://developers.google.com/drive/delegation) that should point you in the right direction. – jonathanberi Nov 26 '13 at 01:09
1 Answers
0
Download the below library it supporting 2legged oauth
google-api-python-client==1.0beta4
and make sure your manifest contains updated calendar(v3) scopes then
from apiclient.oauth import TwoLeggedOAuthCredentials
from apiclient.discovery import build
import httplib2
credentials = TwoLeggedOAuthCredentials(OAUTH_CONSUMER_KEY,OAUTH_CONSUMER_SECRET,'referer')
credentials.requestor = user_email
http = httplib2.Http()
http = credentials.authorize(http)
calendar_service = build('calendar', 'v3', http=http)
list = calendar_service.events().list(calendarId="primary").execute()

epsilon
- 2,849
- 16
- 23

Venkatesh Bachu
- 2,348
- 1
- 18
- 28