Tuesday 29 May 2012

Added Database Support to Store OAuth Access Token

Twitter backend uses OAuth access token to perform operations such as status update, sending directed messages etc. on behalf of the user who authorizes the app. Obtaining the OAuth access token is a three step process which is given below:
  1. When the user tries to access his twitter-account via spectrum, spectrum asks the users to visits an authorization URL that it receives by contacting twitter and asks the user to authorize spectrum. 
  2. The User visits the authorization URL to authorizes spectrum. When the user grants spectrum the requested permissions, twitter redirects the user to another page where it provides a unique number called PIN that has to be returned to the application (spectrum). 
  3. The user then returns to spectrum and gives the PIN that he/she obtained from twitter. Spectrum then exchanges this PIN for OAuth access token from twitter, which grants spectrum access to the the user's twitter account. 
In order to avoid having to go through this three step process each time the user logs in, twitter-backend stores the OAuth access token in a database and uses it directly the next time user logs in. 

No comments:

Post a Comment