class OmniAuth::Strategies::LinkedIn

Public Instance Methods

access_token() click to toggle source
# File lib/omniauth/strategies/linkedin.rb, line 53
def access_token
  ::OAuth2::AccessToken.new(client, oauth2_access_token.token, {
    :mode => :query,
    :param_name => 'oauth2_access_token',
    :expires_in => oauth2_access_token.expires_in,
    :expires_at => oauth2_access_token.expires_at
  })
end
Also aliased as: oauth2_access_token
callback_url() click to toggle source
# File lib/omniauth/strategies/linkedin.rb, line 47
def callback_url
  full_host + script_name + callback_path
end
oauth2_access_token()
Alias for: access_token
raw_info() click to toggle source
# File lib/omniauth/strategies/linkedin.rb, line 62
def raw_info
  @raw_info ||= access_token.get("/v1/people/~:(#{option_fields.join(',')})?format=json").parsed
end

Private Instance Methods

option_fields() click to toggle source
# File lib/omniauth/strategies/linkedin.rb, line 68
def option_fields
  fields = options.fields
  fields.map! { |f| f == "picture-url" ? "picture-url;secure=true" : f } if !!options[:secure_image_url]
  fields
end
user_name() click to toggle source
# File lib/omniauth/strategies/linkedin.rb, line 74
def user_name
  name = "#{raw_info['firstName']} #{raw_info['lastName']}".strip
  name.empty? ? nil : name
end