stormpath-omniauth 1.0.0.beta → 1.0.0.beta.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
data/README.md CHANGED
@@ -1,3 +1,4 @@
1
+
1
2
  # Stormpath OmniAuth Strategy
2
3
 
3
4
  Stormpath is the first easy, secure user management and authentication service
@@ -21,53 +22,38 @@ for developers. This is an OmniAuth strategy that will integrate with Stormpath.
21
22
  rake spec
22
23
  ```
23
24
 
24
- ## Required Configuration Options
25
-
26
- In order to use the Stormpath OmniAuth Strategy, three configuration options
27
- must be specified. These options can be passed in a hash (second parameter of
28
- the Strategy constructor), or (more commonly) set up by Rack during the "setup"
29
- phase.
25
+ ## Usage
30
26
 
31
- With Rack:
27
+ To use this with Rails, include the following initializer:
32
28
 
33
29
  ```ruby
30
+ # if using 'stormpath-rails'
31
+
34
32
  Rails.application.config.middleware.use OmniAuth::Builder do
35
- provider :stormpath, :setup => lambda { |env|
36
- env['omniauth.strategy'].options[:auth_redirect] = '/session/new'
37
- env['omniauth.strategy'].options[:authenticator_class] = ::User
38
- env['omniauth.strategy'].options[:obtain_uid] = Proc.new { |o| o.stormpath_url }
33
+ provider :stormpath, setup: -> env {
34
+ env['omniauth.strategy'].options[:stormpath_application] = ::Stormpath::Rails::Client.application
39
35
  }
40
36
  end
41
37
  ```
42
38
 
43
- A quick explanation of the three required options:
44
-
45
- ### auth_redirect
46
-
47
- Where to redirect the browser in order to display a form that will collect
48
- login information.
49
-
50
- ### authenticator_class
51
-
52
- A class who will implement a method "authenticate" and return an object
53
- representation (or superset) of a Stormpath Account. If you're using
54
- stormpath-rails, this will be the class that's included the
55
- Stormpath::Rails::Account module (::User, in this project's sample app).
39
+ Check out this [Rails sample app][rails-omniauth-sample].
56
40
 
57
- ### obtain_uid
58
-
59
- A method invoked on the object returned from the "authenticate" method which
60
- returns a value that OmniAuth uses to uniquely identify a user in your system.
61
- If you're using stormpath-rails, this will look something like:
41
+ To use this with Sinatra, include the following:
62
42
 
63
43
  ```ruby
64
- obtain_uid = Proc.new { |obj| obj.stormpath_url }
44
+ use OmniAuth::Builder do
45
+ provider :stormpath, setup: -> env {
46
+ env['omniauth.strategy'].options[:stormpath_application] = ::MySinatraApp.get_application
47
+ }
48
+ end
49
+
65
50
  ```
66
51
 
67
- If your application is not storing any Stormpath data in a local database and
68
- your authenticate method returned an instance of Stormpath::Resource::Account,
69
- then this method could look like:
52
+ Check out this [Sinatra sample app][sinatra-omniauth-sample].
70
53
 
71
- ```ruby
72
- obtain_uid = Proc.new { |account| account.href }
73
- ```
54
+ The Stormpath OmniAuth strategy requires only that you pass (as an option) a
55
+ reference to an instance of Stormpath::Resource::Application that the strategy
56
+ will use to authenticate login attempts.
57
+
58
+ [sinatra-omniauth-sample]: https://github.com/stormpath/stormpath-ruby-samples/tree/master/sinatra-omniauth
59
+ [rails-omniauth-sample]: https://github.com/stormpath/stormpath-ruby-samples/tree/master/rails-omniauth
@@ -1,3 +1,3 @@
1
1
  module StormpathOmniauth
2
- VERSION = "1.0.0.beta"
2
+ VERSION = "1.0.0.beta.2"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: stormpath-omniauth
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.0.beta
4
+ version: 1.0.0.beta.2
5
5
  prerelease: 6
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: 2013-06-13 00:00:00.000000000 Z
13
+ date: 2013-08-13 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: bcrypt-ruby
@@ -51,7 +51,7 @@ dependencies:
51
51
  requirements:
52
52
  - - '='
53
53
  - !ruby/object:Gem::Version
54
- version: 1.0.0.beta
54
+ version: 1.0.0.beta.2
55
55
  type: :runtime
56
56
  prerelease: false
57
57
  version_requirements: !ruby/object:Gem::Requirement
@@ -59,7 +59,7 @@ dependencies:
59
59
  requirements:
60
60
  - - '='
61
61
  - !ruby/object:Gem::Version
62
- version: 1.0.0.beta
62
+ version: 1.0.0.beta.2
63
63
  - !ruby/object:Gem::Dependency
64
64
  name: capybara
65
65
  requirement: !ruby/object:Gem::Requirement
@@ -209,17 +209,17 @@ dependencies:
209
209
  requirement: !ruby/object:Gem::Requirement
210
210
  none: false
211
211
  requirements:
212
- - - ! '>='
212
+ - - '='
213
213
  - !ruby/object:Gem::Version
214
- version: '0'
214
+ version: 1.0.0.beta.2
215
215
  type: :development
216
216
  prerelease: false
217
217
  version_requirements: !ruby/object:Gem::Requirement
218
218
  none: false
219
219
  requirements:
220
- - - ! '>='
220
+ - - '='
221
221
  - !ruby/object:Gem::Version
222
- version: '0'
222
+ version: 1.0.0.beta.2
223
223
  - !ruby/object:Gem::Dependency
224
224
  name: vcr
225
225
  requirement: !ruby/object:Gem::Requirement