0
我遇到了一個有趣的問題,我想爲其他人記錄Tumblr的oauth實現。當我使用下面的代碼時,我收到了一個「400錯誤請求」,當我檢查wireshark中的respose時,我發現這是從tumblr回來的。「這種實現不支持帶外(」oob「)回調。 」。由於我的tumblr應用程序有一個我已明確設置的回調字段,因此更加嚴重。Rails + Oauth + Tumblr
# Your tumblr details:
key = "Your Key"
secret = "Your Secret"
site = "http://www.tumblr.com"
# puts 'Setting up request'
@consumer = OAuth::Consumer.new(key, secret, { :site => site,
:request_token_path => '/oauth/request_token',
:authorize_path => '/oauth/authorize',
:access_token_path => '/oauth/access_token',
:http_method => :post
})
puts 'Asking for token, dies here.'
@request_token = @consumer.get_request_token()
puts 'Got Token Storing'
session[:request_token][email protected]_token
puts 'Redirecting'
redirect_to @request_token.authorize_url