Class: OmniAuth::Strategies::Xiaonei

Inherits:
OAuth2
  • Object
show all
Defined in:
lib/omniauth/strategies/xiaonei.rb

Instance Method Summary collapse

Instance Method Details

#raw_infoObject



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_phaseObject

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.authorize_url({:redirect_uri => callback_url}.merge(authorize_params))
end