Class: OmniAuth::Strategies::IVLE

Inherits:
Object
  • Object
show all
Includes:
OmniAuth::Strategy
Defined in:
lib/omniauth/strategies/ivle.rb

Instance Method Summary collapse

Instance Method Details

#profileObject

fetch user profile



35
36
37
38
39
40
41
42
43
44
45
# File 'lib/omniauth/strategies/ivle.rb', line 35

def profile
  return @profile unless @profile.nil?

  token = request.params["token"]
  profile_url = "#{options.profile_url}?APIKey=#{options.api_key}&AuthToken=#{token}"

  conn = Faraday.new(url: profile_url)
  response = conn.get
  json = MultiJson.decode(response.body)
  @profile = json["Results"][0]
end

#request_phaseObject



14
15
16
# File 'lib/omniauth/strategies/ivle.rb', line 14

def request_phase
  redirect "#{options.}?apikey=#{options.api_key}&url=#{callback_url}"
end