Sunday, January 04, 2009

 

OAuth - API access delegation.

Wish you a happy new year!

I recently read about OAuth - a standard for API access delegation. The idea is really quite simple - multiple sites need to collaborate, but there is no open standard to allow for this. OAuth to the rescue. OAuth defines the protocol to be used by such web-sites which need to collaborate.

Consider that I have an account on two web-sites. Say www.photos.com, which allows me to upload and manage my photo albums and www.prints.com, which allows to order prints of pictures. Now I need to print my photos from www.prints.com and I would have liked to access some of my pictures from www.photos.com (on my behalf) and make prints of those. OAuth can help these two websites collaborate.

Here is how it works - I go to www.prints.com and put in my request to order prints. It asks me for the location of the pictures and I choose www.photos.com. Using OAuth it takes me to www.photos.com, where I am authenticated and www.photos.com checks about the images I would like to share with www.prints.com and for how long. Then after I have granted the authorization, www.prints.com can retrieve the pictures from www.photos.com on my behalf and generate the required prints.

The good thing is that you use your credentials only on that particular website (in this www.photos.com) and never need to share your credentials with other websites. Also, the protocol provides for things in a secure manner.

For further reading check out the following links:
http://oauth.net/
http://oauth.net/documentation/getting-started

Details about leveraging OAuth to interface with google apps:
http://code.google.com/apis/accounts/docs/OAuth.html

Google has provided for a neat playground for one to understand OAuth:
http://googlecodesamples.com/oauth_playground/

Happy learning in 2009!

Labels: , ,


This page is powered by Blogger. Isn't yours?