thincloud-authentication 0.2.1 → 0.3.0

Sign up to get free protection for your applications and to get access to all the features.
data/README.md CHANGED
@@ -70,6 +70,7 @@ Set the `layout` option to customize the layout used by all thincloud-authentica
70
70
  Thincloud::Authentication.configure do |config|
71
71
  config.layout = "other"
72
72
  end
73
+ ```
73
74
 
74
75
  ### Mailers
75
76
 
@@ -84,19 +85,37 @@ end
84
85
 
85
86
  ### Additional provider strategies
86
87
 
87
- Add a key to the `providers` hash with the name of the strategy, followed by additional options for `scopes` and `fields` as needed. Additionally, you will need to provide environment variables (prefixed with the provider name), with the `consumer_key` and `consumer_secret` values from your OAuth provider.
88
+ * Require the `omniauth-#{provider}` gem before the `thincloud-authentication` gem in the `Gemfile`:
89
+
90
+ ```ruby
91
+ gem "omniauth-linkedin"
92
+ gem "omniauth-stripe-connect"
93
+ gem "thincloud-authentication"
94
+ ```
95
+
96
+ * Add a key to the `providers` hash with the name of the strategy, followed by additional options for `require`, `scopes` and `fields` as needed. Additionally, you will need to provide environment variables (prefixed with the provider name), with the `consumer_key` and `consumer_secret` values from your OAuth provider.
88
97
 
89
- To enable the [LinkedIn](https://github.com/skorks/omniauth-linkedin) provider:
98
+ To enable the [LinkedIn](https://github.com/skorks/omniauth-linkedin) and [Stripe Connect](https://github.com/isaacsanders/omniauth-stripe-connect) providers:
90
99
 
91
- * Provide values for `ENV["LINKEDIN_CONSUMER_KEY"]` and `ENV["LINKEDIN_CONSUMER_SECRET"]`
100
+ * Provide values for following environment variables:
101
+ * `ENV["LINKEDIN_CONSUMER_KEY"]`
102
+ * `ENV["LINKEDIN_CONSUMER_SECRET"]`
103
+ * `ENV["STRIPE_CONNECT_CONSUMER_KEY"]`
104
+ * `ENV["STRIPE_CONNECT_CONSUMER_SECRET"]`
92
105
  * Add the file `config/initializers/thincloud_authentication.rb` with the following contents:
93
106
 
94
107
  ```ruby
95
108
  Thincloud::Authentication.configure do |config|
96
- config.providers[:linkedin] = {
97
- scopes: "r_emailaddress r_basicprofile",
98
- fields: ["id", "email-address", "first-name", "last-name", "headline",
99
- "industry", "picture-url", "location", "public-profile-url"]
109
+ config.providers = {
110
+ linkedin: {
111
+ scopes: "r_emailaddress r_basicprofile",
112
+ fields: ["id", "email-address", "first-name", "last-name", "headline",
113
+ "industry", "picture-url", "location", "public-profile-url"]
114
+ },
115
+ stripe_connect: {
116
+ require: "omniauth-stripe-connect",
117
+ scopes: "read_write"
118
+ }
100
119
  }
101
120
  end
102
121
  ```
@@ -119,6 +138,15 @@ Using the example above, you will have the following routes locally:
119
138
  * `logout_url` points to "/logout" - Make sure to use the `delete` method to logout.
120
139
 
121
140
 
141
+ ### Redirection
142
+
143
+ You can customize the paths used to redirect users after login, logout and registration by overriding the corresponding methods in your ApplicationController, or specific controllers, as needed.
144
+
145
+ * `after_login_path` is used after the user logs in.
146
+ * `after_logout_path` is used after the user logs out.
147
+ * `after_registration_path` is used after the user registers.
148
+
149
+
122
150
  ## TODO
123
151
 
124
152
  * Add "forgot password" functionality
@@ -10,10 +10,12 @@ module Thincloud
10
10
 
11
11
  config = Thincloud::Authentication.configuration || Configuration.new
12
12
  strategies = config.providers.keys
13
- strategies.each { |strategy| require "omniauth-#{strategy}" }
13
+ strategies.each do |strategy|
14
+ lib = config.providers[strategy][:require] || "omniauth-#{strategy}"
15
+ require lib
16
+ end
14
17
 
15
18
  app.middleware.use ::OmniAuth::Builder do
16
-
17
19
  # always provide the Identity strategy
18
20
  provider :identity, fields: [:email], model: Identity,
19
21
  on_failed_registration: RegistrationsController.action(:new)
@@ -1,5 +1,5 @@
1
1
  module Thincloud
2
2
  module Authentication
3
- VERSION = "0.2.1"
3
+ VERSION = "0.3.0"
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: thincloud-authentication
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.1
4
+ version: 0.3.0
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -10,7 +10,7 @@ authors:
10
10
  autorequire:
11
11
  bindir: bin
12
12
  cert_chain: []
13
- date: 2012-10-13 00:00:00.000000000 Z
13
+ date: 2012-10-14 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: rails
@@ -60,22 +60,6 @@ dependencies:
60
60
  - - ~>
61
61
  - !ruby/object:Gem::Version
62
62
  version: 1.1.0
63
- - !ruby/object:Gem::Dependency
64
- name: omniauth-linkedin
65
- requirement: !ruby/object:Gem::Requirement
66
- none: false
67
- requirements:
68
- - - ~>
69
- - !ruby/object:Gem::Version
70
- version: 0.0.8
71
- type: :runtime
72
- prerelease: false
73
- version_requirements: !ruby/object:Gem::Requirement
74
- none: false
75
- requirements:
76
- - - ~>
77
- - !ruby/object:Gem::Version
78
- version: 0.0.8
79
63
  - !ruby/object:Gem::Dependency
80
64
  name: cane
81
65
  requirement: !ruby/object:Gem::Requirement
@@ -99,7 +83,7 @@ dependencies:
99
83
  requirements:
100
84
  - - ~>
101
85
  - !ruby/object:Gem::Version
102
- version: 1.3.3
86
+ version: 1.4.0
103
87
  type: :development
104
88
  prerelease: false
105
89
  version_requirements: !ruby/object:Gem::Requirement
@@ -107,7 +91,7 @@ dependencies:
107
91
  requirements:
108
92
  - - ~>
109
93
  - !ruby/object:Gem::Version
110
- version: 1.3.3
94
+ version: 1.4.0
111
95
  - !ruby/object:Gem::Dependency
112
96
  name: minitest
113
97
  requirement: !ruby/object:Gem::Requirement
@@ -147,7 +131,7 @@ dependencies:
147
131
  requirements:
148
132
  - - ~>
149
133
  - !ruby/object:Gem::Version
150
- version: 0.1.3
134
+ version: 0.2.0
151
135
  type: :development
152
136
  prerelease: false
153
137
  version_requirements: !ruby/object:Gem::Requirement
@@ -155,7 +139,7 @@ dependencies:
155
139
  requirements:
156
140
  - - ~>
157
141
  - !ruby/object:Gem::Version
158
- version: 0.1.3
142
+ version: 0.2.0
159
143
  - !ruby/object:Gem::Dependency
160
144
  name: minitest-rails-shoulda
161
145
  requirement: !ruby/object:Gem::Requirement
@@ -163,7 +147,7 @@ dependencies:
163
147
  requirements:
164
148
  - - ~>
165
149
  - !ruby/object:Gem::Version
166
- version: 0.1.0
150
+ version: 0.2.0
167
151
  type: :development
168
152
  prerelease: false
169
153
  version_requirements: !ruby/object:Gem::Requirement
@@ -171,7 +155,7 @@ dependencies:
171
155
  requirements:
172
156
  - - ~>
173
157
  - !ruby/object:Gem::Version
174
- version: 0.1.0
158
+ version: 0.2.0
175
159
  - !ruby/object:Gem::Dependency
176
160
  name: rb-fsevent
177
161
  requirement: !ruby/object:Gem::Requirement
@@ -195,7 +179,7 @@ dependencies:
195
179
  requirements:
196
180
  - - ~>
197
181
  - !ruby/object:Gem::Version
198
- version: 0.6.4
182
+ version: 0.7.1
199
183
  type: :development
200
184
  prerelease: false
201
185
  version_requirements: !ruby/object:Gem::Requirement
@@ -203,7 +187,7 @@ dependencies:
203
187
  requirements:
204
188
  - - ~>
205
189
  - !ruby/object:Gem::Version
206
- version: 0.6.4
190
+ version: 0.7.1
207
191
  - !ruby/object:Gem::Dependency
208
192
  name: mocha
209
193
  requirement: !ruby/object:Gem::Requirement
@@ -211,7 +195,7 @@ dependencies:
211
195
  requirements:
212
196
  - - ~>
213
197
  - !ruby/object:Gem::Version
214
- version: 0.12.4
198
+ version: 0.12.7
215
199
  type: :development
216
200
  prerelease: false
217
201
  version_requirements: !ruby/object:Gem::Requirement
@@ -219,7 +203,7 @@ dependencies:
219
203
  requirements:
220
204
  - - ~>
221
205
  - !ruby/object:Gem::Version
222
- version: 0.12.4
206
+ version: 0.12.7
223
207
  description: Rails Engine to provide authentication for Thincloud applications
224
208
  email:
225
209
  - pcohen@newleaders.com
@@ -268,7 +252,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
268
252
  version: '0'
269
253
  segments:
270
254
  - 0
271
- hash: 697516797273733022
255
+ hash: -3024527014021950158
272
256
  required_rubygems_version: !ruby/object:Gem::Requirement
273
257
  none: false
274
258
  requirements:
@@ -277,7 +261,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
277
261
  version: '0'
278
262
  segments:
279
263
  - 0
280
- hash: 697516797273733022
264
+ hash: -3024527014021950158
281
265
  requirements: []
282
266
  rubyforge_project:
283
267
  rubygems_version: 1.8.24