开发者

omniauth alway got low level oauth_token from twitter

1. updated app's "Access Level" to "read, write, and direct messages". (two days ago at dev.twitter.com/apps)

2. lastest omniauth gem.

gem update omniauth
Updating installed gems
Nothing to update

3. oauth via web.

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

4. got oauth_token/oauth_token_secret correctly. CAN read mentions form twitter. but CAN NOT read direct message.

5. the @testuser's oauth_token at dev.twitter.com/apps/xxxxx/my_token is:

'AAAAAAA' (Permission Level is RWD)

6. the oauth_taken got via omniauth is

'BBBBBBB' (Permission Level is RW)

  get '/auth/twitter/callback' do
    omniauth = request.env['omniauth.auth']   
    oauth_token = omniauth['credentials']['开发者_Go百科token']

Question is : How can I get the high level(RWD) oauth_token via omniauth?

thanks for reading!


It is a bug of omniauth.

I create a issues,and software-project@github submit a pull request today. https://github.com/intridea/omniauth/pull/395

Due to lates Twitter API changes the authorize_path in omniauth should update too.

source Diff: https://github.com/intridea/omniauth/pull/395/files


Have you tried omniauth-twitter gem? It should work with latest omniauth.

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

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜