【问题标题】:omniauth alway got low level oauth_token from twitteromn​​iauth 总是从 twitter 获得低级别的 oauth_token
【发布时间】:2011-09-30 03:38:11
【问题描述】:

1。 将应用程序的“访问级别”更新为“读取、写入和直接消息”。 (两天前在 dev.twitter.com/apps)

2。 最新的omniauth gem。

gem update omniauth
Updating installed gems
Nothing to update

3。 通过网络进行 oauth。

   use OmniAuth::Builder do
      provider :twitter, APP_API_KEY, APP_SECRET
    end

4。 正确获得了 oauth_token/oauth_token_secret。 可以阅读来自推特的提及。 但不能阅读直接消息。

5。 @testuser 在 dev.twitter.com/apps/xxxxx/my_token 的 oauth_token 是:

'AAAAAAA'(权限级别为 RWD)

6。 通过omniauth 得到的oauth_taken 是

'BBBBBBB'(权限级别为 RW)

  get '/auth/twitter/callback' do
    omniauth = request.env['omniauth.auth']   
    oauth_token = omniauth['credentials']['token']

问题是: 如何通过omniauth获得高级(RWD)oauth_token?

感谢阅读!

【问题讨论】:

    标签: ruby permissions twitter twitter-oauth omniauth


    【解决方案1】:

    这是omniauth的一个bug。

    我创建了一个问题,software-project@github 今天提交了一个拉取请求。 https://github.com/intridea/omniauth/pull/395

    由于最新的 Twitter API 更改,omniauth 中的 authorize_path 也应该更新。

    来源差异: https://github.com/intridea/omniauth/pull/395/files

    【讨论】:

      【解决方案2】:

      你试过omniauth-twitter gem吗?它应该适用于最新的omniauth。

      https://github.com/arunagw/omniauth-twitter

      【讨论】:

        猜你喜欢
        • 2014-10-18
        • 1970-01-01
        • 1970-01-01
        • 2012-01-06
        • 2011-10-06
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        相关资源
        最近更新 更多