Twitter OAUTH 和 Win32 EXE 桌面应用程序

发布于 2024-09-28 09:53:08 字数 493 浏览 3 评论 0原文

我一直在针对 Delphi EXE(win32 桌面应用程序)进行编码,以访问 twitter 并执行某些功能。它曾经使用具有 api 限制的基本身份验证。我知道我必须将其转换为 OAuth。我一直在阅读文档,试图确定最佳方法。我知道最好的方法是使用带有回调 url 的 Web 浏览器。我还知道 Twitter 包含基于 Pin 图 (oob) 的身份验证方法。我认为这是使用此应用程序的途径,但我想确定一下,因为这不是无缝的。它要求用户进入应用程序外部并获取 PIN 码。它也不那么安全,因为返回的访问令牌永远不会过期。

我正在使用 Indy v10 组件执行 GET/POST 操作,因此我想知道是否有办法使用它们来执行此操作,并且能够执行回调而不使用 Pin 身份验证方法。

谁能帮助我吗?

另外,我一直在尝试让 Chuck Beasley 的 Twitter 类在 Delphi 7 和 Indy v10 中工作,但我遇到了麻烦。 IdObjs 和 Idsys 不再存在。有人让这门课适合我的场景吗? 谢谢, 大卫

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

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

够运 2024-10-05 09:53:08

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

OAuth is a standard used for Web applications, its text is liberally littered with the word 'agent', meaning a browser. The best solution IMHO is, if possible, to actually have a callback URL, meaning you have your own site which provides the service to back your application functionality. There are services that make this possible for third parties already, like JanRain. If these options are not feasible (meaning you cannot provide a true WWW site for the callback URL) not feasible, then your only option is indeed the out-of-band authentication, oob. Don't even think about having the OAuth authentication call back the app listening on some port, that is completely unreliable for 1) the vast majority of apps will sit behind some sort of NAT device (router, outbound proxy) which makes them unreachable from the OAuth prvider and 2) the OS firewall will block your incoming calls.

未央 2024-10-05 09:53:08

同时,Beasly 的 Twitter 类已扩展/更新;请参阅最新版本

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

In the mean time, Beasly's Twitter class has been expanded/updated; see the latest incarnation

I've started a library that uses Synapse to access twitter. It can use OOB/PIN authentication and predefined oauth token/secret. It can be extended to use browser based auth. Currently written using FPC but should be adaptable to Delphi quite easily. FPCTwit code

妖妓 2024-10-05 09:53:08

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

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

虽然我不使用 Indy,但是 ICS

You may wanna try my take on twitter, supports unicode as well unlike the other delphi implementations:

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

I don't use Indy though, but ICS

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文