Twitter OAuth question
I'm making a Twitter client in Java, and I've came to a problem I don't know how to solve it.
How the hell开发者_StackOverflow中文版 I store open auth for twitter? I mean it doesn't make very sense for a person to allow an application every time he wants to use the client. I've been look at the Twitter documentation, but I must say, it's really poor in terms of Java.
So do you guy have some idea to solve this?
Thanks in advance!
After your application successfully authenticates to Twitter, you will receive two strings: OAuthToken and OAuthTokenSecret. You store these tokens in a cookie, a user settings file, or wherever makes sense for your application.
Then, whenever you are making a call to the Twitter API, you retrieve these strings from the cookie or the user settings file, or wherever, and include them in the API call.
Or is there something about your question that I don't understand?
Yes, unless the user revokes the permission of your application.
Most of the time you need to store the twitter username and two tokens (public and secret). You get this tokens after you submit the password to the authorization twitter page.
So finally you would only need those three things to post and retrieve Twitter data.
Hope it helps.
精彩评论