omniauth-auth0 2.2.0 → 2.4.2

Sign up to get free protection for your applications and to get access to all the features.
@@ -82,6 +82,10 @@ describe OmniAuth::Strategies::Auth0 do
82
82
  expect(redirect_url).to have_query('client_id')
83
83
  expect(redirect_url).to have_query('redirect_uri')
84
84
  expect(redirect_url).not_to have_query('auth0Client')
85
+ expect(redirect_url).not_to have_query('connection')
86
+ expect(redirect_url).not_to have_query('connection_scope')
87
+ expect(redirect_url).not_to have_query('prompt')
88
+ expect(redirect_url).not_to have_query('screen_hint')
85
89
  end
86
90
 
87
91
  it 'redirects to hosted login page' do
@@ -95,6 +99,46 @@ describe OmniAuth::Strategies::Auth0 do
95
99
  expect(redirect_url).to have_query('redirect_uri')
96
100
  expect(redirect_url).to have_query('connection', 'abcd')
97
101
  expect(redirect_url).not_to have_query('auth0Client')
102
+ expect(redirect_url).not_to have_query('connection_scope')
103
+ expect(redirect_url).not_to have_query('prompt')
104
+ expect(redirect_url).not_to have_query('screen_hint')
105
+ end
106
+
107
+ it 'redirects to the hosted login page with connection_scope' do
108
+ get 'auth/auth0?connection_scope=identity_provider_scope'
109
+ expect(last_response.status).to eq(302)
110
+ redirect_url = last_response.headers['Location']
111
+ expect(redirect_url).to start_with('https://samples.auth0.com/authorize')
112
+ expect(redirect_url)
113
+ .to have_query('connection_scope', 'identity_provider_scope')
114
+ end
115
+
116
+ it 'redirects to hosted login page with prompt=login' do
117
+ get 'auth/auth0?prompt=login'
118
+ expect(last_response.status).to eq(302)
119
+ redirect_url = last_response.headers['Location']
120
+ expect(redirect_url).to start_with('https://samples.auth0.com/authorize')
121
+ expect(redirect_url).to have_query('response_type', 'code')
122
+ expect(redirect_url).to have_query('state')
123
+ expect(redirect_url).to have_query('client_id')
124
+ expect(redirect_url).to have_query('redirect_uri')
125
+ expect(redirect_url).to have_query('prompt', 'login')
126
+ expect(redirect_url).not_to have_query('auth0Client')
127
+ expect(redirect_url).not_to have_query('connection')
128
+ end
129
+
130
+ it 'redirects to hosted login page with screen_hint=signup' do
131
+ get 'auth/auth0?screen_hint=signup'
132
+ expect(last_response.status).to eq(302)
133
+ redirect_url = last_response.headers['Location']
134
+ expect(redirect_url).to start_with('https://samples.auth0.com/authorize')
135
+ expect(redirect_url).to have_query('response_type', 'code')
136
+ expect(redirect_url).to have_query('state')
137
+ expect(redirect_url).to have_query('client_id')
138
+ expect(redirect_url).to have_query('redirect_uri')
139
+ expect(redirect_url).to have_query('screen_hint', 'signup')
140
+ expect(redirect_url).not_to have_query('auth0Client')
141
+ expect(redirect_url).not_to have_query('connection')
98
142
  end
99
143
 
100
144
  describe 'callback' do
@@ -300,7 +344,7 @@ RSpec::Matchers.define :have_query do |key, value|
300
344
  uri = redirect_uri(actual)
301
345
  query = query(uri)
302
346
  if value.nil?
303
- query[key].length == 1
347
+ query.key?(key)
304
348
  else
305
349
  query[key] == [value]
306
350
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: omniauth-auth0
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.2.0
4
+ version: 2.4.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Auth0
8
- autorequire:
8
+ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2019-04-18 00:00:00.000000000 Z
11
+ date: 2021-01-20 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: omniauth-oauth2
@@ -24,6 +24,20 @@ dependencies:
24
24
  - - "~>"
25
25
  - !ruby/object:Gem::Version
26
26
  version: '1.5'
27
+ - !ruby/object:Gem::Dependency
28
+ name: omniauth
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - "~>"
32
+ - !ruby/object:Gem::Version
33
+ version: '1.9'
34
+ type: :runtime
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - "~>"
39
+ - !ruby/object:Gem::Version
40
+ version: '1.9'
27
41
  - !ruby/object:Gem::Dependency
28
42
  name: bundler
29
43
  requirement: !ruby/object:Gem::Requirement
@@ -52,11 +66,14 @@ extra_rdoc_files: []
52
66
  files:
53
67
  - ".circleci/config.yml"
54
68
  - ".gemrelease"
69
+ - ".github/CODEOWNERS"
55
70
  - ".github/ISSUE_TEMPLATE.md"
56
71
  - ".github/PULL_REQUEST_TEMPLATE.md"
72
+ - ".github/stale.yml"
57
73
  - ".gitignore"
58
74
  - ".rspec"
59
75
  - ".rubocop.yml"
76
+ - ".snyk"
60
77
  - CHANGELOG.md
61
78
  - CODE_OF_CONDUCT.md
62
79
  - CONTRIBUTING.md
@@ -71,6 +88,7 @@ files:
71
88
  - examples/sinatra/config.ru
72
89
  - lib/omniauth-auth0.rb
73
90
  - lib/omniauth-auth0/version.rb
91
+ - lib/omniauth/auth0/errors.rb
74
92
  - lib/omniauth/auth0/jwt_validator.rb
75
93
  - lib/omniauth/auth0/telemetry.rb
76
94
  - lib/omniauth/strategies/auth0.rb
@@ -84,7 +102,7 @@ homepage: https://github.com/auth0/omniauth-auth0
84
102
  licenses:
85
103
  - MIT
86
104
  metadata: {}
87
- post_install_message:
105
+ post_install_message:
88
106
  rdoc_options: []
89
107
  require_paths:
90
108
  - lib
@@ -99,8 +117,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
99
117
  - !ruby/object:Gem::Version
100
118
  version: '0'
101
119
  requirements: []
102
- rubygems_version: 3.0.3
103
- signing_key:
120
+ rubygems_version: 3.0.9
121
+ signing_key:
104
122
  specification_version: 4
105
123
  summary: OmniAuth OAuth2 strategy for the Auth0 platform.
106
124
  test_files: