Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Work flow for authentication and API use with Twitter on OAuth

I'm a bit confused about all this OAuth bruhaha in the sense that all the examples I can find are for web applications and none of them for desktop applications.

I understand the Web application work flow, but that includes some redirections between the web app and twitter.

  • How does one do this in an desktop application?
  • How does the redirects work?
  • Should I have to include a Web Browser object?
  • Is there a way to go around this?
  • Could anyone point me to resources instead of a full blown solution please?

Thanks

like image 688
Gustavo Carreno Avatar asked Nov 26 '25 22:11

Gustavo Carreno


2 Answers

Not sure which language you're using, but the .NET library for Twitter called Tweetsharp has a post on using Tweetsharp from a desktop app and authenticating via OAuth. See http://tweetsharp.com/?p=68. If you're not using .NET then perhaps it will inspire something you can do?

Basically, what tweetsharp does is launch the browser to the authentication URL and then waits for the user to return. I don't know of any way to do this other than something like that (Or include a WebBrowser control of some kind to launch the authentication URL in your own window).

like image 63
Ryan Farley Avatar answered Nov 30 '25 03:11

Ryan Farley


Here's a straightforward solution, implemented as a set of PHP scripts for running from the command line. Well documented and explained, with a helpful 'verbose' option for debugging.

http://nullinfo.wordpress.com/oauth-twitter/

like image 27
Gabriel Roth Avatar answered Nov 30 '25 02:11

Gabriel Roth