twitter - 在 GPL 桌面应用程序中处理 twitter API key 的标准方法是什么?

标签 twitter twitter-oauth desktop-application

在开发需要访问 twitter API 的桌面应用程序时,必须以某种方式将应用程序的 API key (应用程序特定的消费者 key 和消费者 key )传递给用户。 Twitter 的 API TOS 声明应用程序的 API key 不能公开,如果发生这种情况,他们会重置它。当该应用程序处于 GPL 之下时,这意味着开发人员需要向用户提供源代码,该用户如何能够在不公开的情况下获得 API key ?有没有标准的方法来处理这个问题?
谢谢。

编辑:
为了澄清这种情况,我将它们以纯文本形式存储在我的代码中 cree.py就一个有意识的决定而言。但是昨天 Twitter 支持团队联系我说他们已经重置了我的 key ,他们的理由如下:

C. You should not solicit another developer's consumer keys or consumer secrets especially if they will be stored or used for actions outside of that developer's control. Keys and secrets that are compromised will be reset by Twitter. For example, online services that ask for these values in order to provide a "tweet-branding" service are not allowed. https://dev.twitter.com/terms/api-terms If an application's keys are posted publicly, it allows for external parties to hijack the application's API access. This presents an enormous abuse risk, and as such we've reset your API keys. Please take care to ensure that these keys are not posted publicly again.



谢谢,
Twitter API 政策

最佳答案

好吧,TTYtter显然使用了荣誉系统:

# yes, this is plaintext. obfuscation would be ludicrously easy to crack,
# and there is no way to hide them effectively or fully in a Perl script.
# so be a good neighbour and leave this the fark alone, okay? stealing
# credentials is mean and inconvenient to users. this is blessed by
# arrangement with Twitter. don't be a d*ck. thanks for your cooperation.
$oauthkey = (!length($oauthkey) || $oauthkey eq 'X') ?
        "XXXXXXXXXXXXXXXXXXXXX" : $oauthkey;
$oauthsecret = (!length($oauthsecret) || $oauthsecret eq 'X') ?
        "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX" : $oauthsecret;

(我已经用 Xs 替换了实际的键,以减少任何人滥用它们的麻烦,但请放心,它们在实际源中完全存在!)

此外,我在 Rules of the Road 中没有看到任何内容实际上要求你对这些事情保密:我看到的最接近的事情是声明“被泄露的 key 和 secret 将被 Twitter 重置。”;不过,他们从未真正说出“妥协”的含义。

关于twitter - 在 GPL 桌面应用程序中处理 twitter API key 的标准方法是什么?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/7682245/

相关文章:

ios - 仅 Twitter API 应用程序模式身份验证

twitter - Twitter API授权未能在浏览器中进行CORS预检

iphone - 推特官方SDK

ios - PFUser logInWithAuthTypeInBackground(错误 : Twitter auth configuration missing)

java - 将桌面应用程序转换为服务器+浏览器应用程序

java - Java 中的桌面应用程序

c# - 将 SQL 数据库转换为 .sql

ruby-on-rails - rails3 devise omniauth 推特配置

javascript - Twitter 按钮和 Google Page Speed

android - 使用 twitter4j 回调登录