omniauth-auth0 1.2.0 → 1.3.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.travis.yml +0 -0
- data/Gemfile +1 -1
- data/README.md +2 -2
- data/Rakefile +2 -1
- data/lib/auth0/version.rb +1 -1
- data/lib/omniauth/strategies/auth0.rb +2 -2
- data/omniauth-auth0.gemspec +11 -5
- data/spec/omniauth/strategies/auth0_spec.rb +12 -5
- data/spec/spec_helper.rb +1 -1
- metadata +67 -24
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 05c5b449f7be964fb837070c954f284e432fe2f3
|
4
|
+
data.tar.gz: f6c37ee4ade8bc429c76f524924f5480c60f8556
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6b7803e4c457f940eb3d236a1b356564ab14093ed6dd3fe9bdeee3ac13c57395e8a1911909ee678aa3a19ff36c9dd85305eec5569875d06c03f9d2dbee8e8b3d
|
7
|
+
data.tar.gz: 0daf87a9767431012304e795cdebd5c7358b4d14c469170db0ec11775dcc688edd2556df22e760e994af941da0c4fe7d80001710deba2c18067568f3660aa3dd
|
data/.travis.yml
ADDED
File without changes
|
data/Gemfile
CHANGED
data/README.md
CHANGED
@@ -18,7 +18,7 @@ Then `bundle install`.
|
|
18
18
|
|
19
19
|
```ruby
|
20
20
|
Rails.application.config.middleware.use OmniAuth::Builder do
|
21
|
-
provider :auth0, ENV['
|
21
|
+
provider :auth0, ENV['AUTH0_CLIENT_ID'], ENV['AUTH0_CLIENT_SECRET'], ENV['AUTH0_DOMAIN']
|
22
22
|
end
|
23
23
|
```
|
24
24
|
|
@@ -26,7 +26,7 @@ end
|
|
26
26
|
|
27
27
|
```ruby
|
28
28
|
use OmniAuth::Builder do
|
29
|
-
provider :auth0, ENV['
|
29
|
+
provider :auth0, ENV['AUTH0_CLIENT_ID'], ENV['AUTH0_CLIENT_SECRET'], ENV['AUTH0_DOMAIN']
|
30
30
|
end
|
31
31
|
```
|
32
32
|
|
data/Rakefile
CHANGED
data/lib/auth0/version.rb
CHANGED
@@ -17,6 +17,8 @@ module OmniAuth
|
|
17
17
|
|
18
18
|
def initialize(app, *args, &block)
|
19
19
|
super
|
20
|
+
fail(ArgumentError.new("Received wrong number of arguments. #{args.inspect}")) if @options[:namespace].nil?
|
21
|
+
|
20
22
|
@options.provider_ignores_state = args[3] unless args[3].nil?
|
21
23
|
@options.connection = args[4] unless args[4].nil?
|
22
24
|
|
@@ -39,8 +41,6 @@ module OmniAuth
|
|
39
41
|
|
40
42
|
credentials do
|
41
43
|
hash = {'token' => access_token.token}
|
42
|
-
# hash.merge!('refresh_token' => access_token.refresh_token) if access_token.expires? && access_token.refresh_token
|
43
|
-
# hash.merge!('expires_at' => access_token.expires_at) if access_token.expires?
|
44
44
|
hash.merge!('expires' => true)
|
45
45
|
if access_token.params
|
46
46
|
hash.merge!('id_token' => access_token.params['id_token'])
|
data/omniauth-auth0.gemspec
CHANGED
@@ -9,7 +9,12 @@ Gem::Specification.new do |s|
|
|
9
9
|
s.email = ["support@auth0.com"]
|
10
10
|
s.homepage = "https://github.com/auth0/omniauth-auth0"
|
11
11
|
s.summary = %q{Omniauth OAuth2 strategy for the Auth0 platform.}
|
12
|
-
s.description = %q{
|
12
|
+
s.description = %q{Auth0 is an authentication broker that supports social identity providers as well as enterprise identity providers such as Active Directory, LDAP, Google Apps, Salesforce.
|
13
|
+
|
14
|
+
OmniAuth is a library that standardizes multi-provider authentication for web applications. It was created to be powerful, flexible, and do as little as possible.
|
15
|
+
|
16
|
+
omniauth-auth0 is the omniauth strategy for Auth0.
|
17
|
+
}
|
13
18
|
|
14
19
|
s.rubyforge_project = "omniauth-auth0"
|
15
20
|
|
@@ -20,10 +25,11 @@ Gem::Specification.new do |s|
|
|
20
25
|
|
21
26
|
s.add_runtime_dependency 'omniauth-oauth2', '~> 1.1'
|
22
27
|
|
23
|
-
s.add_development_dependency 'rspec',
|
24
|
-
s.add_development_dependency 'rack-test'
|
25
|
-
s.add_development_dependency 'simplecov'
|
26
|
-
s.add_development_dependency 'webmock'
|
28
|
+
s.add_development_dependency 'rspec', '~> 2.7'
|
29
|
+
s.add_development_dependency 'rack-test', '~> 0.6', '>= 0.6.3'
|
30
|
+
s.add_development_dependency 'simplecov', '~> 0.9', '>= 0.9.1'
|
31
|
+
s.add_development_dependency 'webmock', '~> 1.20', '>= 1.20.4'
|
32
|
+
s.add_development_dependency 'rake', '~> 10.3', '>= 10.3.2'
|
27
33
|
|
28
34
|
s.license = 'MIT'
|
29
35
|
end
|
@@ -22,7 +22,7 @@ describe OmniAuth::Strategies::Auth0 do
|
|
22
22
|
end
|
23
23
|
|
24
24
|
subject do
|
25
|
-
OmniAuth::Strategies::Auth0.new(app,
|
25
|
+
OmniAuth::Strategies::Auth0.new(app,
|
26
26
|
"client_id", "client_secret", "tenny.auth0.com:3000").tap do |strategy|
|
27
27
|
strategy.stub(:request) { @request }
|
28
28
|
end
|
@@ -43,6 +43,12 @@ describe OmniAuth::Strategies::Auth0 do
|
|
43
43
|
subject.options.client_options.token_url.
|
44
44
|
should == "https://tenny.auth0.com:3000/oauth/token"
|
45
45
|
end
|
46
|
+
|
47
|
+
it "should raise an ArgumentError error if no namespace passed" do
|
48
|
+
expect {
|
49
|
+
OmniAuth::Strategies::Auth0.new(app, "client_id", "client_secret")
|
50
|
+
}.to raise_error(ArgumentError)
|
51
|
+
end
|
46
52
|
end
|
47
53
|
|
48
54
|
context "request phase" do
|
@@ -53,7 +59,7 @@ describe OmniAuth::Strategies::Auth0 do
|
|
53
59
|
end
|
54
60
|
|
55
61
|
it "authorize params" do
|
56
|
-
subject.stub(:request) { double('Request', {:params => {
|
62
|
+
subject.stub(:request) { double('Request', {:params => {
|
57
63
|
"connection" => "google-oauth2", "redirect_uri" => "redirect_uri" }, :env => {}}) }
|
58
64
|
subject.authorize_params.include?("connection").should == true
|
59
65
|
subject.authorize_params.include?("state").should == true
|
@@ -128,17 +134,18 @@ describe OmniAuth::Strategies::Auth0 do
|
|
128
134
|
@access_token.stub(:expires?)
|
129
135
|
@access_token.stub(:expires_at)
|
130
136
|
@access_token.stub(:refresh_token)
|
137
|
+
@access_token.stub(:params)
|
131
138
|
subject.stub(:access_token) { @access_token }
|
132
139
|
end
|
133
140
|
|
134
141
|
it 'returns a Hash' do
|
135
142
|
subject.credentials.should be_a(Hash)
|
136
143
|
end
|
137
|
-
|
144
|
+
|
138
145
|
it 'returns the token' do
|
139
|
-
@access_token.stub(:token) {
|
146
|
+
@access_token.stub(:token) {
|
140
147
|
{
|
141
|
-
:access_token => "OTqSFa9zrh0VRGAZHH4QPJISCoynRwSy9FocUazuaU950EVcISsJo3pST11iTCiI",
|
148
|
+
:access_token => "OTqSFa9zrh0VRGAZHH4QPJISCoynRwSy9FocUazuaU950EVcISsJo3pST11iTCiI",
|
142
149
|
:token_type => "bearer"
|
143
150
|
} }
|
144
151
|
subject.credentials['token'][:access_token].should eq('OTqSFa9zrh0VRGAZHH4QPJISCoynRwSy9FocUazuaU950EVcISsJo3pST11iTCiI')
|
data/spec/spec_helper.rb
CHANGED
@@ -12,6 +12,6 @@ RSpec.configure do |config|
|
|
12
12
|
config.include WebMock::API
|
13
13
|
config.include Rack::Test::Methods
|
14
14
|
config.extend OmniAuth::Test::StrategyMacros, :type => :strategy
|
15
|
-
config.
|
15
|
+
config.color = true
|
16
16
|
config.formatter = 'documentation'
|
17
17
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: omniauth-auth0
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.3.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Auth0
|
@@ -10,86 +10,130 @@ authors:
|
|
10
10
|
autorequire:
|
11
11
|
bindir: bin
|
12
12
|
cert_chain: []
|
13
|
-
date:
|
13
|
+
date: 2015-01-21 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: omniauth-oauth2
|
17
17
|
requirement: !ruby/object:Gem::Requirement
|
18
18
|
requirements:
|
19
|
-
- -
|
19
|
+
- - ~>
|
20
20
|
- !ruby/object:Gem::Version
|
21
21
|
version: '1.1'
|
22
22
|
type: :runtime
|
23
23
|
prerelease: false
|
24
24
|
version_requirements: !ruby/object:Gem::Requirement
|
25
25
|
requirements:
|
26
|
-
- -
|
26
|
+
- - ~>
|
27
27
|
- !ruby/object:Gem::Version
|
28
28
|
version: '1.1'
|
29
29
|
- !ruby/object:Gem::Dependency
|
30
30
|
name: rspec
|
31
31
|
requirement: !ruby/object:Gem::Requirement
|
32
32
|
requirements:
|
33
|
-
- -
|
33
|
+
- - ~>
|
34
34
|
- !ruby/object:Gem::Version
|
35
35
|
version: '2.7'
|
36
36
|
type: :development
|
37
37
|
prerelease: false
|
38
38
|
version_requirements: !ruby/object:Gem::Requirement
|
39
39
|
requirements:
|
40
|
-
- -
|
40
|
+
- - ~>
|
41
41
|
- !ruby/object:Gem::Version
|
42
42
|
version: '2.7'
|
43
43
|
- !ruby/object:Gem::Dependency
|
44
44
|
name: rack-test
|
45
45
|
requirement: !ruby/object:Gem::Requirement
|
46
46
|
requirements:
|
47
|
-
- -
|
47
|
+
- - ~>
|
48
48
|
- !ruby/object:Gem::Version
|
49
|
-
version: '0'
|
49
|
+
version: '0.6'
|
50
|
+
- - '>='
|
51
|
+
- !ruby/object:Gem::Version
|
52
|
+
version: 0.6.3
|
50
53
|
type: :development
|
51
54
|
prerelease: false
|
52
55
|
version_requirements: !ruby/object:Gem::Requirement
|
53
56
|
requirements:
|
54
|
-
- -
|
57
|
+
- - ~>
|
58
|
+
- !ruby/object:Gem::Version
|
59
|
+
version: '0.6'
|
60
|
+
- - '>='
|
55
61
|
- !ruby/object:Gem::Version
|
56
|
-
version:
|
62
|
+
version: 0.6.3
|
57
63
|
- !ruby/object:Gem::Dependency
|
58
64
|
name: simplecov
|
59
65
|
requirement: !ruby/object:Gem::Requirement
|
60
66
|
requirements:
|
61
|
-
- -
|
67
|
+
- - ~>
|
68
|
+
- !ruby/object:Gem::Version
|
69
|
+
version: '0.9'
|
70
|
+
- - '>='
|
62
71
|
- !ruby/object:Gem::Version
|
63
|
-
version:
|
72
|
+
version: 0.9.1
|
64
73
|
type: :development
|
65
74
|
prerelease: false
|
66
75
|
version_requirements: !ruby/object:Gem::Requirement
|
67
76
|
requirements:
|
68
|
-
- -
|
77
|
+
- - ~>
|
69
78
|
- !ruby/object:Gem::Version
|
70
|
-
version: '0'
|
79
|
+
version: '0.9'
|
80
|
+
- - '>='
|
81
|
+
- !ruby/object:Gem::Version
|
82
|
+
version: 0.9.1
|
71
83
|
- !ruby/object:Gem::Dependency
|
72
84
|
name: webmock
|
73
85
|
requirement: !ruby/object:Gem::Requirement
|
74
86
|
requirements:
|
75
|
-
- -
|
87
|
+
- - ~>
|
88
|
+
- !ruby/object:Gem::Version
|
89
|
+
version: '1.20'
|
90
|
+
- - '>='
|
76
91
|
- !ruby/object:Gem::Version
|
77
|
-
version:
|
92
|
+
version: 1.20.4
|
78
93
|
type: :development
|
79
94
|
prerelease: false
|
80
95
|
version_requirements: !ruby/object:Gem::Requirement
|
81
96
|
requirements:
|
82
|
-
- -
|
97
|
+
- - ~>
|
98
|
+
- !ruby/object:Gem::Version
|
99
|
+
version: '1.20'
|
100
|
+
- - '>='
|
101
|
+
- !ruby/object:Gem::Version
|
102
|
+
version: 1.20.4
|
103
|
+
- !ruby/object:Gem::Dependency
|
104
|
+
name: rake
|
105
|
+
requirement: !ruby/object:Gem::Requirement
|
106
|
+
requirements:
|
107
|
+
- - ~>
|
108
|
+
- !ruby/object:Gem::Version
|
109
|
+
version: '10.3'
|
110
|
+
- - '>='
|
111
|
+
- !ruby/object:Gem::Version
|
112
|
+
version: 10.3.2
|
113
|
+
type: :development
|
114
|
+
prerelease: false
|
115
|
+
version_requirements: !ruby/object:Gem::Requirement
|
116
|
+
requirements:
|
117
|
+
- - ~>
|
118
|
+
- !ruby/object:Gem::Version
|
119
|
+
version: '10.3'
|
120
|
+
- - '>='
|
83
121
|
- !ruby/object:Gem::Version
|
84
|
-
version:
|
85
|
-
description:
|
122
|
+
version: 10.3.2
|
123
|
+
description: |
|
124
|
+
Auth0 is an authentication broker that supports social identity providers as well as enterprise identity providers such as Active Directory, LDAP, Google Apps, Salesforce.
|
125
|
+
|
126
|
+
OmniAuth is a library that standardizes multi-provider authentication for web applications. It was created to be powerful, flexible, and do as little as possible.
|
127
|
+
|
128
|
+
omniauth-auth0 is the omniauth strategy for Auth0.
|
86
129
|
email:
|
87
130
|
- support@auth0.com
|
88
131
|
executables: []
|
89
132
|
extensions: []
|
90
133
|
extra_rdoc_files: []
|
91
134
|
files:
|
92
|
-
-
|
135
|
+
- .gitignore
|
136
|
+
- .travis.yml
|
93
137
|
- Gemfile
|
94
138
|
- LICENSE.md
|
95
139
|
- README.md
|
@@ -110,21 +154,20 @@ require_paths:
|
|
110
154
|
- lib
|
111
155
|
required_ruby_version: !ruby/object:Gem::Requirement
|
112
156
|
requirements:
|
113
|
-
- -
|
157
|
+
- - '>='
|
114
158
|
- !ruby/object:Gem::Version
|
115
159
|
version: '0'
|
116
160
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
117
161
|
requirements:
|
118
|
-
- -
|
162
|
+
- - '>='
|
119
163
|
- !ruby/object:Gem::Version
|
120
164
|
version: '0'
|
121
165
|
requirements: []
|
122
166
|
rubyforge_project: omniauth-auth0
|
123
|
-
rubygems_version: 2.
|
167
|
+
rubygems_version: 2.2.2
|
124
168
|
signing_key:
|
125
169
|
specification_version: 4
|
126
170
|
summary: Omniauth OAuth2 strategy for the Auth0 platform.
|
127
171
|
test_files:
|
128
172
|
- spec/omniauth/strategies/auth0_spec.rb
|
129
173
|
- spec/spec_helper.rb
|
130
|
-
has_rdoc:
|