Class: OmniAuth::Strategies::YahooJp

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

Instance Method Summary collapse

Instance Method Details

#build_access_tokenObject



53
54
55
56
57
58
59
60
61
62
# File 'lib/omniauth/strategies/yahoojp.rb', line 53

def build_access_token
  token_params = {
    :code => request.params['code'],
    :redirect_uri => callback_url,
    :grant_type => 'authorization_code',
    :headers => {'Authorization' => HTTPAuth::Basic.pack_authorization(client.id, client.secret)}
  }

  client.get_token(token_params);
end

#prune!(hash) ⇒ Object



46
47
48
49
50
51
# File 'lib/omniauth/strategies/yahoojp.rb', line 46

def prune!(hash)
  hash.delete_if do |_, value|
    prune!(value) if value.is_a?(Hash)
    value.nil? || (value.respond_to?(:empty?) && value.empty?)
  end
end

#raw_infoObject



41
42
43
44
# File 'lib/omniauth/strategies/yahoojp.rb', line 41

def raw_info
  access_token.options[:mode] = :header
  @raw_info ||= access_token.get('https://userinfo.yahooapis.jp/yconnect/v1/attribute?schema=openid').parsed
end

#request_phaseObject



17
18
19
# File 'lib/omniauth/strategies/yahoojp.rb', line 17

def request_phase
  super
end