Class: OmniAuth::Strategies::Xiaonei
- Inherits:
-
OAuth2
- Object
- OAuth2
- OmniAuth::Strategies::Xiaonei
- Defined in:
- lib/omniauth/strategies/xiaonei.rb
Instance Method Summary collapse
- #raw_info ⇒ Object
-
#request_phase ⇒ Object
option :api_url, “api.renren.com/restserver.do”.
Instance Method Details
#raw_info ⇒ Object
24 25 26 27 28 29 30 31 32 33 34 35 36 37 |
# File 'lib/omniauth/strategies/xiaonei.rb', line 24 def raw_info opts = { :method => "users.getInfo", :v => "1.0", :format => "JSON", :access_token => access_token.token }.merge!(fields) conn = Faraday.new(:url => "http://api.renren.com") do |faraday| faraday.request :url_encoded faraday.response :logger faraday.adapter Faraday.default_adapter end @raw_info ||= parse(conn.post("/restserver.do", append_sig(opts)).body).first || {} end |
#request_phase ⇒ Object
option :api_url, “api.renren.com/restserver.do”
20 21 22 |
# File 'lib/omniauth/strategies/xiaonei.rb', line 20 def request_phase redirect client.auth_code.({:redirect_uri => callback_url}.merge()) end |