easy_auth-linked_in 0.0.1
Sign up to get free protection for your applications and to get access to all the features.
- data/README.md +51 -0
- data/Rakefile +10 -0
- data/app/models/easy_auth/identities/o_auth1/linked_in.rb +3 -0
- data/lib/easy_auth/linked_in/engine.rb +9 -0
- data/lib/easy_auth/linked_in/version.rb +5 -0
- data/lib/easy_auth/linked_in.rb +2 -0
- data/lib/easy_auth/models/identities/o_auth1/linked_in.rb +22 -0
- data/lib/easy_auth/o_auth1/linked_in/controllers/sessions.rb +12 -0
- data/lib/easy_auth/o_auth1/linked_in/controllers.rb +4 -0
- data/lib/easy_auth/o_auth1/linked_in.rb +20 -0
- data/lib/easy_auth-linked_in.rb +1 -0
- data/lib/tasks/easy_auth_tasks.rake +4 -0
- metadata +274 -0
data/README.md
ADDED
@@ -0,0 +1,51 @@
|
|
1
|
+
# EasyAuth-Github #
|
2
|
+
|
3
|
+
[![Build Status](https://secure.travis-ci.org/dockyard/easy_auth-github.png?branch=master)](http://travis-ci.org/dockyard/easy_auth-github)
|
4
|
+
[![Dependency Status](https://gemnasium.com/dockyard/easy_auth-github.png?travis)](https://gemnasium.com/dockyard/easy_auth-github)
|
5
|
+
[![Code Climate](https://codeclimate.com/badge.png)](https://codeclimate.com/github/dockyard/easy_auth-github)
|
6
|
+
|
7
|
+
Dead simple drop in authentication for Rails
|
8
|
+
|
9
|
+
## Installation ##
|
10
|
+
|
11
|
+
In your Gemfile add the following:
|
12
|
+
|
13
|
+
```ruby
|
14
|
+
gem 'easy_auth-github'
|
15
|
+
```
|
16
|
+
|
17
|
+
After running Bundler you'll need to install the migrations
|
18
|
+
|
19
|
+
```ruby
|
20
|
+
rake easy_auth-github:install:migrations
|
21
|
+
```
|
22
|
+
|
23
|
+
Then run your migrations.
|
24
|
+
|
25
|
+
## Authors ##
|
26
|
+
|
27
|
+
[Brian Cardarella](http://linked_in.com/bcardarella)
|
28
|
+
|
29
|
+
## Versioning ##
|
30
|
+
|
31
|
+
This gem follows [Semantic Versioning](http://semver.org)
|
32
|
+
|
33
|
+
## Want to help? ##
|
34
|
+
|
35
|
+
Stable branches are created based upon each minor version. Please make
|
36
|
+
pull requests to specific branches rather than master.
|
37
|
+
|
38
|
+
Please make sure you include tests!
|
39
|
+
|
40
|
+
Unles Rails drops support for Ruby 1.8.7 we will continue to use the
|
41
|
+
hash-rocket syntax. Please respect this.
|
42
|
+
|
43
|
+
Don't use tabs to indent, two spaces are the standard.
|
44
|
+
|
45
|
+
## Legal ##
|
46
|
+
|
47
|
+
[DockYard](http://dockyard.com), LLC © 2012
|
48
|
+
|
49
|
+
[@dockyard](http://linked_in.com/dockyard)
|
50
|
+
|
51
|
+
[Licensed under the MIT license](http://www.opensource.org/licenses/mit-license.php)
|
data/Rakefile
ADDED
@@ -0,0 +1,10 @@
|
|
1
|
+
require 'bundler/setup'
|
2
|
+
require 'rspec/core/rake_task'
|
3
|
+
Bundler::GemHelper.install_tasks
|
4
|
+
|
5
|
+
RSpec::Core::RakeTask.new('default') do |t|
|
6
|
+
t.pattern = FileList['spec/**/*_spec.rb']
|
7
|
+
end
|
8
|
+
|
9
|
+
APP_RAKEFILE = File.expand_path("../spec/dummy/Rakefile", __FILE__)
|
10
|
+
load 'rails/tasks/engine.rake'
|
@@ -0,0 +1,22 @@
|
|
1
|
+
module EasyAuth::Models::Identities::OAuth1::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
|
@@ -0,0 +1,12 @@
|
|
1
|
+
module EasyAuth::OAuth1::LinkedIn::Controllers::Sessions
|
2
|
+
private
|
3
|
+
|
4
|
+
def after_successful_sign_in_with_o_auth1_for_linked_in(identity)
|
5
|
+
end
|
6
|
+
|
7
|
+
def after_successful_sign_in_url_with_o_auth1_for_linked_in(identity)
|
8
|
+
end
|
9
|
+
|
10
|
+
def after_failed_sign_in_with_o_auth1_for_linked_in(identity)
|
11
|
+
end
|
12
|
+
end
|
@@ -0,0 +1,20 @@
|
|
1
|
+
require 'easy_auth/linked_in/engine'
|
2
|
+
|
3
|
+
module EasyAuth
|
4
|
+
def self.o_auth1_linked_in_identity_model(controller)
|
5
|
+
EasyAuth::Identities::OAuth1::LinkedIn
|
6
|
+
end
|
7
|
+
|
8
|
+
module OAuth1::LinkedIn
|
9
|
+
extend ActiveSupport::Autoload
|
10
|
+
autoload :Controllers
|
11
|
+
end
|
12
|
+
|
13
|
+
module Controllers::Sessions
|
14
|
+
include EasyAuth::OAuth1::LinkedIn::Controllers::Sessions
|
15
|
+
end
|
16
|
+
|
17
|
+
module Models::Identities::OAuth1
|
18
|
+
autoload :LinkedIn
|
19
|
+
end
|
20
|
+
end
|
@@ -0,0 +1 @@
|
|
1
|
+
require 'easy_auth/linked_in'
|
metadata
ADDED
@@ -0,0 +1,274 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: easy_auth-linked_in
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.0.1
|
5
|
+
prerelease:
|
6
|
+
platform: ruby
|
7
|
+
authors:
|
8
|
+
- Brian Cardarella
|
9
|
+
- Dan McClain
|
10
|
+
autorequire:
|
11
|
+
bindir: bin
|
12
|
+
cert_chain: []
|
13
|
+
date: 2012-11-02 00:00:00.000000000 Z
|
14
|
+
dependencies:
|
15
|
+
- !ruby/object:Gem::Dependency
|
16
|
+
name: easy_auth-o_auth1
|
17
|
+
requirement: !ruby/object:Gem::Requirement
|
18
|
+
none: false
|
19
|
+
requirements:
|
20
|
+
- - ! '>='
|
21
|
+
- !ruby/object:Gem::Version
|
22
|
+
version: '0'
|
23
|
+
type: :runtime
|
24
|
+
prerelease: false
|
25
|
+
version_requirements: !ruby/object:Gem::Requirement
|
26
|
+
none: false
|
27
|
+
requirements:
|
28
|
+
- - ! '>='
|
29
|
+
- !ruby/object:Gem::Version
|
30
|
+
version: '0'
|
31
|
+
- !ruby/object:Gem::Dependency
|
32
|
+
name: sqlite3
|
33
|
+
requirement: !ruby/object:Gem::Requirement
|
34
|
+
none: false
|
35
|
+
requirements:
|
36
|
+
- - ! '>='
|
37
|
+
- !ruby/object:Gem::Version
|
38
|
+
version: '0'
|
39
|
+
type: :development
|
40
|
+
prerelease: false
|
41
|
+
version_requirements: !ruby/object:Gem::Requirement
|
42
|
+
none: false
|
43
|
+
requirements:
|
44
|
+
- - ! '>='
|
45
|
+
- !ruby/object:Gem::Version
|
46
|
+
version: '0'
|
47
|
+
- !ruby/object:Gem::Dependency
|
48
|
+
name: rspec-rails
|
49
|
+
requirement: !ruby/object:Gem::Requirement
|
50
|
+
none: false
|
51
|
+
requirements:
|
52
|
+
- - ! '>='
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: '0'
|
55
|
+
type: :development
|
56
|
+
prerelease: false
|
57
|
+
version_requirements: !ruby/object:Gem::Requirement
|
58
|
+
none: false
|
59
|
+
requirements:
|
60
|
+
- - ! '>='
|
61
|
+
- !ruby/object:Gem::Version
|
62
|
+
version: '0'
|
63
|
+
- !ruby/object:Gem::Dependency
|
64
|
+
name: capybara
|
65
|
+
requirement: !ruby/object:Gem::Requirement
|
66
|
+
none: false
|
67
|
+
requirements:
|
68
|
+
- - ! '>='
|
69
|
+
- !ruby/object:Gem::Version
|
70
|
+
version: '0'
|
71
|
+
type: :development
|
72
|
+
prerelease: false
|
73
|
+
version_requirements: !ruby/object:Gem::Requirement
|
74
|
+
none: false
|
75
|
+
requirements:
|
76
|
+
- - ! '>='
|
77
|
+
- !ruby/object:Gem::Version
|
78
|
+
version: '0'
|
79
|
+
- !ruby/object:Gem::Dependency
|
80
|
+
name: vcr
|
81
|
+
requirement: !ruby/object:Gem::Requirement
|
82
|
+
none: false
|
83
|
+
requirements:
|
84
|
+
- - ! '>='
|
85
|
+
- !ruby/object:Gem::Version
|
86
|
+
version: '0'
|
87
|
+
type: :development
|
88
|
+
prerelease: false
|
89
|
+
version_requirements: !ruby/object:Gem::Requirement
|
90
|
+
none: false
|
91
|
+
requirements:
|
92
|
+
- - ! '>='
|
93
|
+
- !ruby/object:Gem::Version
|
94
|
+
version: '0'
|
95
|
+
- !ruby/object:Gem::Dependency
|
96
|
+
name: fakeweb
|
97
|
+
requirement: !ruby/object:Gem::Requirement
|
98
|
+
none: false
|
99
|
+
requirements:
|
100
|
+
- - ! '>='
|
101
|
+
- !ruby/object:Gem::Version
|
102
|
+
version: '0'
|
103
|
+
type: :development
|
104
|
+
prerelease: false
|
105
|
+
version_requirements: !ruby/object:Gem::Requirement
|
106
|
+
none: false
|
107
|
+
requirements:
|
108
|
+
- - ! '>='
|
109
|
+
- !ruby/object:Gem::Version
|
110
|
+
version: '0'
|
111
|
+
- !ruby/object:Gem::Dependency
|
112
|
+
name: poltergeist
|
113
|
+
requirement: !ruby/object:Gem::Requirement
|
114
|
+
none: false
|
115
|
+
requirements:
|
116
|
+
- - ! '>='
|
117
|
+
- !ruby/object:Gem::Version
|
118
|
+
version: '0'
|
119
|
+
type: :development
|
120
|
+
prerelease: false
|
121
|
+
version_requirements: !ruby/object:Gem::Requirement
|
122
|
+
none: false
|
123
|
+
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
|
+
- - ! '>='
|
141
|
+
- !ruby/object:Gem::Version
|
142
|
+
version: '0'
|
143
|
+
- !ruby/object:Gem::Dependency
|
144
|
+
name: database_cleaner
|
145
|
+
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
|
+
requirements:
|
196
|
+
- - ! '>='
|
197
|
+
- !ruby/object:Gem::Version
|
198
|
+
version: '0'
|
199
|
+
type: :development
|
200
|
+
prerelease: false
|
201
|
+
version_requirements: !ruby/object:Gem::Requirement
|
202
|
+
none: false
|
203
|
+
requirements:
|
204
|
+
- - ! '>='
|
205
|
+
- !ruby/object:Gem::Version
|
206
|
+
version: '0'
|
207
|
+
- !ruby/object:Gem::Dependency
|
208
|
+
name: launchy
|
209
|
+
requirement: !ruby/object:Gem::Requirement
|
210
|
+
none: false
|
211
|
+
requirements:
|
212
|
+
- - ! '>='
|
213
|
+
- !ruby/object:Gem::Version
|
214
|
+
version: '0'
|
215
|
+
type: :development
|
216
|
+
prerelease: false
|
217
|
+
version_requirements: !ruby/object:Gem::Requirement
|
218
|
+
none: false
|
219
|
+
requirements:
|
220
|
+
- - ! '>='
|
221
|
+
- !ruby/object:Gem::Version
|
222
|
+
version: '0'
|
223
|
+
description: EasyAuth-LinkedIn
|
224
|
+
email:
|
225
|
+
- brian@dockyard.com
|
226
|
+
- bcardarella@gmail.com
|
227
|
+
- rubygems@danmcclain.net
|
228
|
+
executables: []
|
229
|
+
extensions: []
|
230
|
+
extra_rdoc_files: []
|
231
|
+
files:
|
232
|
+
- app/models/easy_auth/identities/o_auth1/linked_in.rb
|
233
|
+
- lib/easy_auth/linked_in/engine.rb
|
234
|
+
- lib/easy_auth/linked_in/version.rb
|
235
|
+
- lib/easy_auth/linked_in.rb
|
236
|
+
- lib/easy_auth/models/identities/o_auth1/linked_in.rb
|
237
|
+
- lib/easy_auth/o_auth1/linked_in/controllers/sessions.rb
|
238
|
+
- lib/easy_auth/o_auth1/linked_in/controllers.rb
|
239
|
+
- lib/easy_auth/o_auth1/linked_in.rb
|
240
|
+
- lib/easy_auth-linked_in.rb
|
241
|
+
- lib/tasks/easy_auth_tasks.rake
|
242
|
+
- Rakefile
|
243
|
+
- README.md
|
244
|
+
homepage: https://github.com/dockyard/easy_auth-linked_in
|
245
|
+
licenses: []
|
246
|
+
post_install_message:
|
247
|
+
rdoc_options: []
|
248
|
+
require_paths:
|
249
|
+
- lib
|
250
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
251
|
+
none: false
|
252
|
+
requirements:
|
253
|
+
- - ! '>='
|
254
|
+
- !ruby/object:Gem::Version
|
255
|
+
version: '0'
|
256
|
+
segments:
|
257
|
+
- 0
|
258
|
+
hash: -959278653868326928
|
259
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
260
|
+
none: false
|
261
|
+
requirements:
|
262
|
+
- - ! '>='
|
263
|
+
- !ruby/object:Gem::Version
|
264
|
+
version: '0'
|
265
|
+
segments:
|
266
|
+
- 0
|
267
|
+
hash: -959278653868326928
|
268
|
+
requirements: []
|
269
|
+
rubyforge_project:
|
270
|
+
rubygems_version: 1.8.23
|
271
|
+
signing_key:
|
272
|
+
specification_version: 3
|
273
|
+
summary: EasyAuth-LinkedIn
|
274
|
+
test_files: []
|