我是Rails的新手!我正在使用Omniauth,到目前为止,没有人做过任何TripIt策略。
TripIt使用oAuth 1.0,我正在使用omniauth-oauth!
到目前为止,我有这段代码:
require 'omniauth-oauth'
require 'multi_xml'
module OmniAuth
module Strategies
class Tripit < OmniAuth::Strategies::OAuth
option :name, "tripit"
option :client_options, {
:site => 'https://api.tripit.com',
:request_token_path => '/oauth/request_token',
:access_token_path => '/oauth/access_token',
:authorize_path => '/oauth/confirm_access'
}
uid do
request.params['username']
end
info do
{
:email => raw_info['feed']['entry']['content']['Email']['EmailAddress']
}
end
extra do
{ 'raw_info' => raw_info }
end
def raw_info
#@raw_info ||= MultiXml.parse(access_token.get("https://api.constantcontact.com/ws/customers/" + request.params['username'] + "/settings/emailaddresses").body)
end
end
end
end
我收到错误:
consumer key not present in request
对此有何帮助?