-
Notifications
You must be signed in to change notification settings - Fork 48
Commit
- Loading branch information
There are no files selected for viewing
Original file line number | Original file line | Diff line number | Diff line change |
---|---|---|---|
@@ -0,0 +1,5 @@ | |||
*.gem | |||
.bundle | |||
Gemfile.lock | |||
pkg/* | |||
*.swp |
Original file line number | Original file line | Diff line number | Diff line change |
---|---|---|---|
@@ -0,0 +1 @@ | |||
rvm 1.9.2@omniauth-linkedin |
Original file line number | Original file line | Diff line number | Diff line change |
---|---|---|---|
@@ -0,0 +1,6 @@ | |||
source "http://rubygems.org" | |||
|
|||
# Specify your gem's dependencies in omniauth-linkedin.gemspec | |||
gemspec | |||
|
|||
gem 'omniauth-oauth', :git => 'https://github.com/intridea/omniauth-oauth.git' |
Original file line number | Original file line | Diff line number | Diff line change |
---|---|---|---|
@@ -0,0 +1 @@ | |||
TODO.... |
Original file line number | Original file line | Diff line number | Diff line change |
---|---|---|---|
@@ -0,0 +1 @@ | |||
require 'bundler/gem_tasks' |
Original file line number | Original file line | Diff line number | Diff line change |
---|---|---|---|
@@ -0,0 +1,9 @@ | |||
require "omniauth-linkedin/version" | |||
require 'omniauth/strategies/linkedin' | |||
|
|||
|
|||
module Omniauth | |||
This comment has been minimized.
Sorry, something went wrong.
This comment has been minimized.
Sorry, something went wrong.
skorks
Author
Owner
|
|||
module Linkedin | |||
# Your code goes here... | |||
end | |||
end |
Original file line number | Original file line | Diff line number | Diff line change |
---|---|---|---|
@@ -0,0 +1,5 @@ | |||
module Omniauth | |||
module Linkedin | |||
VERSION = "0.0.1" | |||
end | |||
end |
Original file line number | Original file line | Diff line number | Diff line change |
---|---|---|---|
@@ -0,0 +1,43 @@ | |||
require 'omniauth/strategies/oauth' | |||
|
|||
module OmniAuth | |||
module Strategies | |||
class LinkedIn < OmniAuth::Strategies::OAuth | |||
option :name, "linkedin" | |||
|
|||
option :client_options, { | |||
:site => 'https://api.linkedin.com', | |||
:request_token_path => '/uas/oauth/requestToken', | |||
:access_token_path => '/uas/oauth/accessToken', | |||
:authorize_url => 'https://www.linkedin.com/uas/oauth/authenticate' | |||
} | |||
|
|||
option :fields, ["id", "first-name", "last-name", "headline", "industry", "picture-url", "public-profile-url"] | |||
|
|||
uid{ raw_info['id'] } | |||
|
|||
info do | |||
{ | |||
:first_name => raw_info['firstName'], | |||
:last_name => raw_info['lastName'], | |||
:headline => raw_info['headline'], | |||
:image => raw_info['pictureUrl'], | |||
:industry => raw_info['industry'], | |||
:urls => { | |||
'public_profile' => raw_info['publicProfileUrl'] | |||
} | |||
} | |||
end | |||
|
|||
extra do | |||
{ 'raw_info' => raw_info } | |||
end | |||
|
|||
def raw_info | |||
@raw_info ||= MultiJson.decode(access_token.get("/v1/people/~:(#{options.fields.join(',')})?format=json").body) | |||
end | |||
end | |||
end | |||
end | |||
|
|||
OmniAuth.config.add_camelization 'linkedin', 'LinkedIn' |
Original file line number | Original file line | Diff line number | Diff line change |
---|---|---|---|
@@ -0,0 +1,23 @@ | |||
# -*- encoding: utf-8 -*- | |||
$:.push File.expand_path("../lib", __FILE__) | |||
require "omniauth-linkedin/version" | |||
|
|||
Gem::Specification.new do |s| | |||
s.name = "omniauth-linkedin" | |||
s.version = Omniauth::Linkedin::VERSION | |||
s.authors = ["Alan Skorkin"] | |||
s.email = ["alan@skorks.com"] | |||
s.homepage = "" | |||
s.summary = %q{LinkedIn strategy for OmniAuth.} | |||
s.description = %q{LinkedIn strategy for OmniAuth.} | |||
|
|||
s.files = `git ls-files`.split("\n") | |||
s.test_files = `git ls-files -- {test,spec,features}/*`.split("\n") | |||
s.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) } | |||
s.require_paths = ["lib"] | |||
|
|||
s.add_runtime_dependency 'omniauth-oauth', '1.0.0.beta1' | |||
|
|||
s.add_development_dependency 'rspec', '~> 2.6.0' | |||
s.add_development_dependency 'rake' | |||
end |
@skorks, Should this (also in
version.rb
) beOmniAuth
? In other words, are modules case sensitive? In other other words, would this cause troublesome problems under certain circumstances?I'm asking for a friend… ❓