3

I have been coding against a Delphi EXE (win32 desktop app) to access twitter and do certain functions. It used to use Basic authentication with the api limitation. I know I have to convert this to OAuth. I have been reading over the documentation trying to determine the best approach. I understand the best method is the Web browser with a call back url. I also know that Twitter includes a Pin Based (oob) authentication method. I figured this was the route to go with this application, but I want to make sure since that is not seamless. It requires the user to go external to the application and get a pin number. It also is not as secure since the access token returned never expires.

I am using Indy v10 components to do the GET/POST operations, so I am wondering if there is a way to do this using them and being able to do a callback and not use the Pin authentication method.

Can anyone help me?

Also I've been trying to get Chuck Beasley's Twitter Class working in Delphi 7 with Indy v10 and I've been having trouble. IdObjs and Idsys don't exist anymore. Has anyone got this class to work with my scenario? Thanks, David

4

3 回答 3

4

OAuth 是一种用于 Web 应用程序的标准,其文本中充斥着“代理”一词,意思是浏览器。恕我直言,最好的解决方案是,如果可能的话,实际上有一个回调 URL,这意味着您拥有自己的站点,该站点提供支持您的应用程序功能的服务。已经有一些服务可以让第三方实现这一点,比如JanRain. 如果这些选项不可行(意味着您无法为回调 URL 提供真正的 WWW 站点)不可行,那么您唯一的选择确实是带外身份验证,oob。甚至不要考虑让 OAuth 身份验证回调在某个端口上侦听的应用程序,这是完全不可靠的 1)绝大多数应用程序将位于某种 NAT 设备(路由器、出站代理)后面,这使得它们无法从OAuth prvider 和 2) 操作系统防火墙将阻止您的来电。

于 2010-10-21T23:48:08.747 回答
1

同时,Beasly 的 Twitter 类已经扩展/更新;看到最新的化身

我已经启动了一个使用 Synapse 访问 twitter 的库。它可以使用 OOB/PIN 身份验证和预定义的 oauth 令牌/秘密。它可以扩展为使用基于浏览器的身份验证。目前使用 FPC 编写,但应该很容易适应 Delphi。FPCTwit代码

于 2012-06-15T09:47:56.273 回答
0

你可能想试试我对 twitter 的看法,它支持 unicode 以及与其他 delphi 实现不同:

http://eden.fm/2011/02/27/twitter-library-for-delphi/

虽然我不使用 Indy,但 ICS

于 2011-02-27T02:39:55.077 回答