Class: OmniAuth::Strategies::Yahoo

Inherits:
OAuth
  • Object
show all
Defined in:
lib/omniauth/strategies/yahoo.rb

Overview

An omniauth 1.0 strategy for yahoo authentication

Instance Method Summary collapse

Instance Method Details

#raw_infoObject

Return info gathered from the v1/user/:id/profile API call



51
52
53
54
55
56
57
# File 'lib/omniauth/strategies/yahoo.rb', line 51

def raw_info
  # This is a public API and does not need signing or authentication
  request = "https://social.yahooapis.com/v1/user/#{uid}/profile?format=json"
  @raw_info ||= MultiJson.decode(access_token.get(request).body)
rescue ::Errno::ETIMEDOUT
  raise ::Timeout::Error
end

#user_infoObject

Provide the “Profile” portion of the raw_info



61
62
63
# File 'lib/omniauth/strategies/yahoo.rb', line 61

def 
  @user_info ||= raw_info.nil? ? {} : raw_info["profile"]
end