Non-web application Authorization - Granting Multiple Times

9 views
Skip to first unread message

Gaurav Vaish

unread,
Jul 28, 2010, 6:35:28 AM7/28/10
to Twitter Development Talk
Hi,

Using Twitter4J API, I have been able to successfully fetch the data
and perform an status update using OAuth.

Here are the results: http://twitter.com/mastergaurav/status/19730194057
(Positive Results)

Problem --
Once a user grants access to the user, how can I reuse the "granted
access" permission over and over again?

Currently, I use Customer Key and Secret to get "OAuth Request
Token" (by first hitting https://twitter.com/oauth/request_token)

And I would not like to hit it over and over again for the same user
(until the permissions are revoked).


How can I achieve the same...


-Gaurav

Taylor Singletary

unread,
Jul 28, 2010, 11:03:06 AM7/28/10
to twitter-deve...@googlegroups.com
Hi Gaurav,

Once you've gone through all the steps of OAuth and have acquired an access token (made up of an oauth_token and oauth_token_secret), you can then persist the access token in whatever means of storage your application uses. Then, when making an API call on behalf of a Twitter user for whom you've acquired an access token, you use your stored tokens instead of renegotiating for them.

How to instantiate your OAuth stack's Access Token is different from library to library, but there are some tips that apply here: http://bit.ly/1token

Taylor

Gaurav Vaish

unread,
Jul 29, 2010, 12:20:56 AM7/29/10
to Twitter Development Talk
Hi Talyor,

Thanks for your input.
It helped. :)

And now I can cache the data (oauth_token_secret and oauth_token) to
avoid multiple authorizations.


-Gaurav
www.mastergaurav.com


On Jul 28, 8:03 pm, Taylor Singletary <taylorsinglet...@twitter.com>
wrote:
> Hi Gaurav,
>
> Once you've gone through all the steps of OAuth and have acquired an access
> token (made up of an oauth_token and oauth_token_secret), you can then
> persist the access token in whatever means of storage your application uses.
> Then, when making an API call on behalf of a Twitter user for whom you've
> acquired an access token, you use your stored tokens instead of
> renegotiating for them.
>
> How to instantiate your OAuth stack's Access Token is different from library
> to library, but there are some tips that apply here:http://bit.ly/1token
>
> Taylor
>
> On Wed, Jul 28, 2010 at 3:35 AM, Gaurav Vaish <gaurav.va...@gmail.com>wrote:
>
> > Hi,
>
> > Using Twitter4J API, I have been able to successfully fetch the data
> > and perform an status update using OAuth.
>
> > Here are the results:http://twitter.com/mastergaurav/status/19730194057
> > (Positive Results)
>
> > Problem --
> >  Once a user grants access to the user, how can I reuse the "granted
> > access" permission over and over again?
>
> >  Currently, I use Customer Key and Secret to get "OAuth Request
> > Token" (by first hittinghttps://twitter.com/oauth/request_token)
Reply all
Reply to author
Forward
0 new messages