Twitter's oauth_callback querystring parameter not working with ASP .NET
I have a web application that is integrating with Twitter's OAuth API. I registered my application with Twitter putting my application's homepage as the callback URL intending to use the oauth_callback querystring parameter to define the actual callback URL. The reason I can't just enter it in with the Twitter application form is because I plan to generate the URL dynamically base开发者_JAVA百科d on several variables so it is not possible to for me enter the true desired URL in Twitter's application form.
When I ran the application Twitter redirected me back to my application homepage instead of the dynamic URL I passed through the oauth_callback. I even tested this using oauth_callback=http://www.google.com
instead of generating it just to avoid the possibility of an invalid URL. I also tried "oauth_callback=" + Server.UrlEncode("http://www.google.com")
just in case it wasn't liking the special characters. Still it ignores oauth_callback and just redirects me back to my application homepage.
I've read a dozen blogs on this issue. Some say that oauth_callback was disabled back in May 2009 while others say it was re-enabled in June 2009.
For what it's worth I'm running this off of localhost but I don't see this being an issue because oauth_callback wouldn't even work when it was set to google.com
Pass oauth_callback={$url}
when you get your request_token. Along with the request token will be oauth_callback_confirmed=true
.
This is the specified flow in OAuth 1.0a.
You can read more about it here http://groups.google.com/group/twitter-api-announce/browse_frm/thread/472500cfe9e7cdb9?hl=en
精彩评论