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 +22 -36
- data/lib/stormpath-omniauth/version.rb +1 -1
- metadata +8 -8
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
|
-
##
|
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
|
-
|
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, :
|
36
|
-
env['omniauth.strategy'].options[:
|
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
|
-
|
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
|
-
|
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
|
-
|
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
|
-
|
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
|
-
|
72
|
-
|
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
|
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-
|
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:
|
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:
|
222
|
+
version: 1.0.0.beta.2
|
223
223
|
- !ruby/object:Gem::Dependency
|
224
224
|
name: vcr
|
225
225
|
requirement: !ruby/object:Gem::Requirement
|