views:

710

answers:

2

I'd like to be able to use the Google Data API from an AppEngine application to update a calendar while not logged in as the calendar's owner or the a user that the calendar is shared with. This is in contrast to the examples here:

http://code.google.com/appengine/articles/more_google_data.html

The login and password for the calendar's owner could be embedded in the application. Is there any way to accomplish the necessary authentication?

+1  A: 

It should be possible using OAuth, i havent used it myself but my understanding is the user logs in and then gives your app permission to access their private data (e.g. Calendar records). Once they have authorised your app you will be able to access their data without them logging in.

Here is an article explaining oauth and the google data api.

http://code.google.com/apis/gdata/articles/oauth.html

Sam
A: 

It's possible to use ClientLogin as described here:

http://code.google.com/apis/accounts/docs/AuthForInstalledApps.html#Response

Note the section at the bottom of the document that mentions handling a CAPTCHA challenge.

There's example code included in the gdata python client in samples/calendar/calendarExample.py

You need to call run_on_app_engine with the right arguments to make this work as described in the Appendix here:

http://code.google.com/appengine/articles/gdata.html

Note that the same document recommends against using ClientLogin for web apps. Using OAuth or AuthSub is the correct solution, but this is simpler and good enough for testing.