OAuth Callback Session
I'm having a problem figuring out to maintain the same session after I get the oauth callback in a servlet. Since th callback come from Twitter and not the clients browser, I get a different session.
开发者_StackOverflow社区Can someone help??
Without knowing about servlets, I offer three pieces of generic advice.
1 - start a new session when you get the OAuth callback.
2 - store a Session Id in a cookie and retrieve later
3 - the OAuth token begins with nnnnnn-XXXXX where nnn is the users twitter Id.
Hope this helps.
You can also provide additional querystring parameters in the callback url and they will be provided when the user returns from authenticating.
I encountered this issue in my development environment, where my callback URL was different from the URL I was accessing my local application from.
So, if the callback URL is http://myapp.apps.com, you should start accessing your application via the same URL (configured via /etc/hosts).
Some further details are available in this post.
精彩评论