Class: OmniAuth::Strategies::IVLE
- Inherits:
-
Object
- Object
- OmniAuth::Strategies::IVLE
- Includes:
- OmniAuth::Strategy
- Defined in:
- lib/omniauth/strategies/ivle.rb
Instance Method Summary collapse
-
#profile ⇒ Object
fetch user profile.
- #request_phase ⇒ Object
Instance Method Details
#profile ⇒ Object
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 = "#{.profile_url}?APIKey=#{.api_key}&AuthToken=#{token}" conn = Faraday.new(url: profile_url) response = conn.get json = MultiJson.decode(response.body) @profile = json["Results"][0] end |
#request_phase ⇒ Object
14 15 16 |
# File 'lib/omniauth/strategies/ivle.rb', line 14 def request_phase redirect "#{.login_url}?apikey=#{.api_key}&url=#{callback_url}" end |