omniauth-linkedin 0.0.7 → 0.0.8
Sign up to get free protection for your applications and to get access to all the features.
- data/README.md +3 -3
- data/lib/omniauth-linkedin/version.rb +1 -1
- data/lib/omniauth/strategies/linkedin.rb +4 -3
- metadata +2 -2
data/README.md
CHANGED
@@ -27,20 +27,20 @@ LinkedIn recently (August 2012) provided the ability to request different permis
|
|
27
27
|
|
28
28
|
By default, omniauth-linkedin requests the following permissions:
|
29
29
|
|
30
|
-
r_basicprofile
|
30
|
+
"r_basicprofile r_emailaddress"
|
31
31
|
|
32
32
|
This allows us to obtain enough information from LinkedIn to satisfy the requirements for the basic auth hash schema.
|
33
33
|
|
34
34
|
To change the scope, simply change your initializer to something like this:
|
35
35
|
|
36
36
|
Rails.application.config.middleware.use OmniAuth::Builder do
|
37
|
-
provider :linkedin, "consumer_key", "consumer_secret", :scope => 'r_fullprofile
|
37
|
+
provider :linkedin, "consumer_key", "consumer_secret", :scope => 'r_fullprofile r_emailaddress r_network'
|
38
38
|
end
|
39
39
|
|
40
40
|
One thing to note is the fact that when you ask for extra permissions, you will probably want to specify the array of fields that you want returned in the omniauth hash. If you don't then only the default fields (see below) will be returned which would defeat the purpose of asking for the extra permissions. So do the following:
|
41
41
|
|
42
42
|
Rails.application.config.middleware.use OmniAuth::Builder do
|
43
|
-
provider :linkedin, "consumer_key", "consumer_secret", :scope => 'r_fullprofile
|
43
|
+
provider :linkedin, "consumer_key", "consumer_secret", :scope => 'r_fullprofile r_emailaddress r_network', :fields => ["id", "email-address", "first-name", "last-name", "headline", "industry", "picture-url", "public-profile-url", "location", "connections"]
|
44
44
|
end
|
45
45
|
|
46
46
|
We have to repeat the list of default fields in order to get the extra 'connections' field.
|
@@ -13,7 +13,8 @@ module OmniAuth
|
|
13
13
|
}
|
14
14
|
|
15
15
|
option :fields, ["id", "email-address", "first-name", "last-name", "headline", "industry", "picture-url", "public-profile-url", "location"]
|
16
|
-
|
16
|
+
|
17
|
+
option :scope, 'r_basicprofile r_emailaddress'
|
17
18
|
|
18
19
|
uid{ raw_info['id'] }
|
19
20
|
|
@@ -42,8 +43,8 @@ module OmniAuth
|
|
42
43
|
end
|
43
44
|
|
44
45
|
def request_phase
|
45
|
-
options.
|
46
|
-
|
46
|
+
options.request_params ||= {}
|
47
|
+
options.request_params[:scope] = options.scope.gsub("+", " ")
|
47
48
|
super
|
48
49
|
end
|
49
50
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: omniauth-linkedin
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.8
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2012-08-
|
12
|
+
date: 2012-08-16 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: omniauth-oauth
|