Fun with OAuth, gdata and the Google APIs Client Library for Python

One of the fun aspects of working in IT is the way the simple things you think you have a handle on give way to more complicated technologies as the problem space changes.  Going from ASCII to Unicode is a good example of this, a transition greatly eased by this great Joel Spolsky piece.

Recently I have had to move from the simple familiarity of Username/Password authentication to OAuth.  Changhun Oh has provided a very useful guide to the OAuth dance.

I need to use OAuth to allow me to programatically post Specification by Example Feature files to a Google Sites Wiki.

Google provide a great page on how to use the Python Google APIs Client Library to authenticate with OAuth 2.0 but if you’re using the older gdata APIs, such as the Google Sites API then it is not immediately apparent where you go next once you are authenticated.

After some digging around I found a blog post by Shraddha Gupta  which showed you how to munge the two together.  The example given was for gmail, below is my soup to nuts example for Google Sites:

This entry was posted in OAuth, Python. Bookmark the permalink.

Comments are closed.