easy_auth-linked_in 0.1.0 → 0.1.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: 3c9cddd7d810670cba0b64af287297215d45d318
4
+ data.tar.gz: a44c0861014dc1156d356648a1b075e5d3d222e5
5
+ SHA512:
6
+ metadata.gz: 190631602813f72156705dd4c81315e8a0c60247ada6dd07591875e33ba5744dd9e7141615c4f3f8dbc9921637ce16980784b7af1eadac917b43b254381eff49
7
+ data.tar.gz: 8a429f664aaad0a8fd51f217b5e064f1b4a6b829e6b9fd762e1127917409b0ec1b3d1918103318a4eb1dc8ff10271473e2848d41a301b7c8a9879ae8d8e8b081
data/README.md CHANGED
@@ -14,13 +14,8 @@ In your Gemfile add the following:
14
14
  gem 'easy_auth-linked_in'
15
15
  ```
16
16
 
17
- After running Bundler you'll need to install the migrations
18
-
19
- ```ruby
20
- rake easy_auth-linked_in:install:migrations
21
- ```
22
-
23
- Then run your migrations.
17
+ Then follow the general installation instructions for
18
+ [EasyAuth](https://github.com/dockyard/easy_auth#installation)
24
19
 
25
20
  ## Authors ##
26
21
 
@@ -0,0 +1,3 @@
1
+ class Identities::Oauth2::LinkedIn < Identities::Oauth2::Base
2
+ include EasyAuth::Models::Identities::Oauth2::LinkedIn
3
+ end
@@ -1,9 +1,5 @@
1
1
  module EasyAuth::LinkedIn
2
2
  class Engine < ::Rails::Engine
3
3
  isolate_namespace EasyAuth::LinkedIn
4
-
5
- config.generators do |g|
6
- g.test_framework :rspec, :view_specs => false
7
- end
8
4
  end
9
5
  end
@@ -1,5 +1,5 @@
1
1
  module EasyAuth
2
2
  module LinkedIn
3
- VERSION = '0.1.0'
3
+ VERSION = '0.1.1'
4
4
  end
5
5
  end
@@ -1,6 +1,6 @@
1
- require 'easy_auth-oauth'
1
+ require 'easy_auth-oauth2'
2
2
  require 'easy_auth/linked_in/engine'
3
3
 
4
- module EasyAuth::Models::Identities::Oauth
4
+ module EasyAuth::Models::Identities::Oauth2
5
5
  autoload :LinkedIn
6
6
  end
@@ -0,0 +1,43 @@
1
+ require 'linkedin-oauth2'
2
+
3
+ module EasyAuth::Models::Identities::Oauth2::LinkedIn
4
+ extend ActiveSupport::Concern
5
+
6
+ def client
7
+ @client ||= LinkedIn::Client.new(EasyAuth.oauth2[:linked_in][:client_id], EasyAuth.oauth2[:linked_in][:secret], self.token)
8
+ end
9
+
10
+ module ClassMethods
11
+ def account_attributes_map
12
+ {:email => 'emailAddress', :first_name => 'firstName', :last_name => 'lastName'}
13
+ end
14
+
15
+ def authorize_url
16
+ "https://www.linkedin.com/uas/oauth2/authorization?state=#{Time.now.to_i}"
17
+ end
18
+
19
+ def oauth2_scope
20
+ 'r_basicprofile r_emailaddress'
21
+ end
22
+
23
+ def account_attributes_url
24
+ '/v1/people/~:(firstName,lastName,emailAddress)?format=json'
25
+ end
26
+
27
+ def token_url
28
+ 'https://www.linkedin.com/uas/oauth2/accessToken'
29
+ end
30
+
31
+ def token_params
32
+ { :mode => :query, :param_name => :oauth2_access_token }
33
+ end
34
+
35
+ def site_url
36
+ 'https://api.linkedin.com/v1'
37
+ end
38
+
39
+ def retrieve_uid(account_attributes)
40
+ account_attributes['emailAddress']
41
+ end
42
+ end
43
+ end
metadata CHANGED
@@ -1,8 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: easy_auth-linked_in
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
5
- prerelease:
4
+ version: 0.1.1
6
5
  platform: ruby
7
6
  authors:
8
7
  - Brian Cardarella
@@ -10,214 +9,132 @@ authors:
10
9
  autorequire:
11
10
  bindir: bin
12
11
  cert_chain: []
13
- date: 2012-11-05 00:00:00.000000000 Z
12
+ date: 2014-03-11 00:00:00.000000000 Z
14
13
  dependencies:
15
14
  - !ruby/object:Gem::Dependency
16
- name: easy_auth-oauth
15
+ name: easy_auth-oauth2
17
16
  requirement: !ruby/object:Gem::Requirement
18
- none: false
19
17
  requirements:
20
18
  - - ~>
21
19
  - !ruby/object:Gem::Version
22
- version: 0.1.0
20
+ version: 0.2.0
23
21
  type: :runtime
24
22
  prerelease: false
25
23
  version_requirements: !ruby/object:Gem::Requirement
26
- none: false
27
24
  requirements:
28
25
  - - ~>
29
26
  - !ruby/object:Gem::Version
30
- version: 0.1.0
27
+ version: 0.2.0
31
28
  - !ruby/object:Gem::Dependency
32
- name: sqlite3
29
+ name: linkedin-oauth2
33
30
  requirement: !ruby/object:Gem::Requirement
34
- none: false
35
31
  requirements:
36
- - - ! '>='
32
+ - - '>='
37
33
  - !ruby/object:Gem::Version
38
34
  version: '0'
39
- type: :development
35
+ type: :runtime
40
36
  prerelease: false
41
37
  version_requirements: !ruby/object:Gem::Requirement
42
- none: false
43
38
  requirements:
44
- - - ! '>='
39
+ - - '>='
45
40
  - !ruby/object:Gem::Version
46
41
  version: '0'
47
42
  - !ruby/object:Gem::Dependency
48
- name: rspec-rails
43
+ name: sqlite3
49
44
  requirement: !ruby/object:Gem::Requirement
50
- none: false
51
45
  requirements:
52
- - - ! '>='
46
+ - - '>='
53
47
  - !ruby/object:Gem::Version
54
48
  version: '0'
55
49
  type: :development
56
50
  prerelease: false
57
51
  version_requirements: !ruby/object:Gem::Requirement
58
- none: false
59
52
  requirements:
60
- - - ! '>='
53
+ - - '>='
61
54
  - !ruby/object:Gem::Version
62
55
  version: '0'
63
56
  - !ruby/object:Gem::Dependency
64
- name: capybara
57
+ name: rspec-rails
65
58
  requirement: !ruby/object:Gem::Requirement
66
- none: false
67
59
  requirements:
68
- - - ! '>='
60
+ - - '>='
69
61
  - !ruby/object:Gem::Version
70
62
  version: '0'
71
63
  type: :development
72
64
  prerelease: false
73
65
  version_requirements: !ruby/object:Gem::Requirement
74
- none: false
75
66
  requirements:
76
- - - ! '>='
67
+ - - '>='
77
68
  - !ruby/object:Gem::Version
78
69
  version: '0'
79
70
  - !ruby/object:Gem::Dependency
80
- name: vcr
71
+ name: capybara
81
72
  requirement: !ruby/object:Gem::Requirement
82
- none: false
83
73
  requirements:
84
- - - ! '>='
74
+ - - '>='
85
75
  - !ruby/object:Gem::Version
86
76
  version: '0'
87
77
  type: :development
88
78
  prerelease: false
89
79
  version_requirements: !ruby/object:Gem::Requirement
90
- none: false
91
80
  requirements:
92
- - - ! '>='
81
+ - - '>='
93
82
  - !ruby/object:Gem::Version
94
83
  version: '0'
95
84
  - !ruby/object:Gem::Dependency
96
- name: fakeweb
85
+ name: vcr
97
86
  requirement: !ruby/object:Gem::Requirement
98
- none: false
99
87
  requirements:
100
- - - ! '>='
88
+ - - '>='
101
89
  - !ruby/object:Gem::Version
102
90
  version: '0'
103
91
  type: :development
104
92
  prerelease: false
105
93
  version_requirements: !ruby/object:Gem::Requirement
106
- none: false
107
94
  requirements:
108
- - - ! '>='
95
+ - - '>='
109
96
  - !ruby/object:Gem::Version
110
97
  version: '0'
111
98
  - !ruby/object:Gem::Dependency
112
99
  name: poltergeist
113
100
  requirement: !ruby/object:Gem::Requirement
114
- none: false
115
101
  requirements:
116
- - - ! '>='
102
+ - - '>='
117
103
  - !ruby/object:Gem::Version
118
104
  version: '0'
119
105
  type: :development
120
106
  prerelease: false
121
107
  version_requirements: !ruby/object:Gem::Requirement
122
- none: false
123
108
  requirements:
124
- - - ! '>='
125
- - !ruby/object:Gem::Version
126
- version: '0'
127
- - !ruby/object:Gem::Dependency
128
- name: capybara-email
129
- requirement: !ruby/object:Gem::Requirement
130
- none: false
131
- requirements:
132
- - - ! '>='
133
- - !ruby/object:Gem::Version
134
- version: '0'
135
- type: :development
136
- prerelease: false
137
- version_requirements: !ruby/object:Gem::Requirement
138
- none: false
139
- requirements:
140
- - - ! '>='
109
+ - - '>='
141
110
  - !ruby/object:Gem::Version
142
111
  version: '0'
143
112
  - !ruby/object:Gem::Dependency
144
113
  name: database_cleaner
145
114
  requirement: !ruby/object:Gem::Requirement
146
- none: false
147
- requirements:
148
- - - ! '>='
149
- - !ruby/object:Gem::Version
150
- version: '0'
151
- type: :development
152
- prerelease: false
153
- version_requirements: !ruby/object:Gem::Requirement
154
- none: false
155
- requirements:
156
- - - ! '>='
157
- - !ruby/object:Gem::Version
158
- version: '0'
159
- - !ruby/object:Gem::Dependency
160
- name: factory_girl_rails
161
- requirement: !ruby/object:Gem::Requirement
162
- none: false
163
- requirements:
164
- - - ~>
165
- - !ruby/object:Gem::Version
166
- version: 1.7.0
167
- type: :development
168
- prerelease: false
169
- version_requirements: !ruby/object:Gem::Requirement
170
- none: false
171
- requirements:
172
- - - ~>
173
- - !ruby/object:Gem::Version
174
- version: 1.7.0
175
- - !ruby/object:Gem::Dependency
176
- name: factory_girl
177
- requirement: !ruby/object:Gem::Requirement
178
- none: false
179
- requirements:
180
- - - ~>
181
- - !ruby/object:Gem::Version
182
- version: 2.6.0
183
- type: :development
184
- prerelease: false
185
- version_requirements: !ruby/object:Gem::Requirement
186
- none: false
187
- requirements:
188
- - - ~>
189
- - !ruby/object:Gem::Version
190
- version: 2.6.0
191
- - !ruby/object:Gem::Dependency
192
- name: bourne
193
- requirement: !ruby/object:Gem::Requirement
194
- none: false
195
115
  requirements:
196
- - - ! '>='
116
+ - - '>='
197
117
  - !ruby/object:Gem::Version
198
118
  version: '0'
199
119
  type: :development
200
120
  prerelease: false
201
121
  version_requirements: !ruby/object:Gem::Requirement
202
- none: false
203
122
  requirements:
204
- - - ! '>='
123
+ - - '>='
205
124
  - !ruby/object:Gem::Version
206
125
  version: '0'
207
126
  - !ruby/object:Gem::Dependency
208
127
  name: launchy
209
128
  requirement: !ruby/object:Gem::Requirement
210
- none: false
211
129
  requirements:
212
- - - ! '>='
130
+ - - '>='
213
131
  - !ruby/object:Gem::Version
214
132
  version: '0'
215
133
  type: :development
216
134
  prerelease: false
217
135
  version_requirements: !ruby/object:Gem::Requirement
218
- none: false
219
136
  requirements:
220
- - - ! '>='
137
+ - - '>='
221
138
  - !ruby/object:Gem::Version
222
139
  version: '0'
223
140
  description: EasyAuth-LinkedIn
@@ -229,42 +146,35 @@ executables: []
229
146
  extensions: []
230
147
  extra_rdoc_files: []
231
148
  files:
232
- - app/models/identities/oauth/linked_in.rb
149
+ - app/models/identities/oauth2/linked_in.rb
233
150
  - lib/easy_auth/linked_in/engine.rb
234
151
  - lib/easy_auth/linked_in/version.rb
235
152
  - lib/easy_auth/linked_in.rb
236
- - lib/easy_auth/models/identities/oauth/linked_in.rb
153
+ - lib/easy_auth/models/identities/oauth2/linked_in.rb
237
154
  - lib/easy_auth-linked_in.rb
238
155
  - Rakefile
239
156
  - README.md
240
157
  homepage: https://github.com/dockyard/easy_auth-linked_in
241
158
  licenses: []
159
+ metadata: {}
242
160
  post_install_message:
243
161
  rdoc_options: []
244
162
  require_paths:
245
163
  - lib
246
164
  required_ruby_version: !ruby/object:Gem::Requirement
247
- none: false
248
165
  requirements:
249
- - - ! '>='
166
+ - - '>='
250
167
  - !ruby/object:Gem::Version
251
168
  version: '0'
252
- segments:
253
- - 0
254
- hash: 2654543114739524974
255
169
  required_rubygems_version: !ruby/object:Gem::Requirement
256
- none: false
257
170
  requirements:
258
- - - ! '>='
171
+ - - '>='
259
172
  - !ruby/object:Gem::Version
260
173
  version: '0'
261
- segments:
262
- - 0
263
- hash: 2654543114739524974
264
174
  requirements: []
265
175
  rubyforge_project:
266
- rubygems_version: 1.8.23
176
+ rubygems_version: 2.0.3
267
177
  signing_key:
268
- specification_version: 3
178
+ specification_version: 4
269
179
  summary: EasyAuth-LinkedIn
270
180
  test_files: []
@@ -1,3 +0,0 @@
1
- class Identities::Oauth::LinkedIn < Identities::Oauth::Base
2
- extend EasyAuth::Models::Identities::Oauth::LinkedIn
3
- end
@@ -1,22 +0,0 @@
1
- module EasyAuth::Models::Identities::Oauth::LinkedIn
2
- def authorize_path
3
- '/uas/oauth/authenticate'
4
- end
5
-
6
- private
7
-
8
- def site_url
9
- 'https://api.linkedin.com'
10
- end
11
-
12
- def retrieve_username(token)
13
- info = ActiveSupport::JSON.decode(token.get('http://api.linkedin.com/v1/people/~?format=json').body)
14
- uri = URI.parse info['siteStandardProfileRequest']['url']
15
- CGI.parse(uri.query)['key'].first
16
- end
17
-
18
- def client_options
19
- super.merge(:request_token_path => "/uas/oauth/requestToken?scope=#{scope}",
20
- :access_token_path => '/uas/oauth/accessToken')
21
- end
22
- end