簡體   English   中英

omniauth 總是從 twitter 獲得低級別的 oauth_token

[英]omniauth alway got low level oauth_token from twitter

1.更新應用程序的“訪問級別”為“閱讀、寫作和直接消息”。 (兩天前在dev.twitter.com/apps)

2.最新的omniauth gem。

 gem update omniauth Updating installed gems Nothing to update

3. oauth 通過 web。

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

4. 正確獲取 oauth_token/oauth_token_secret。 可以閱讀 twitter 的提及。 但無法讀取直接消息。

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?

謝謝閱讀!

這是omniauth的一個錯誤。

我創建了一個問題,software-project@github 今天提交了一個拉取請求。 https://github.com/intridea/omniauth/pull/395

由於最新的 Twitter API 更改,omniauth 中的 authorize_path 也應該更新。

來源差異:https://github.com/intridea/omniauth/pull/395/files

你試過omniauth-twitter gem嗎? 它應該與最新的omniauth一起使用。

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

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM