omniauth-oauth_oidc 0.0.1 → 0.0.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.
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 0fa89dcb282db4791409a5a30f6a116f8d099a261443444e2e820978050a1eaf
|
4
|
+
data.tar.gz: da9b63b81d17123989eaec89474ccf4335f1a6b55432c62b4c7f51a6c705ca32
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1beadd010d56b1b0a81a2d9693246e187c2e05f12b6f467f04e128561efb27e692702b3d509f3d102f73d6ade750180742229afbe4188c7d84717b74882bf11e
|
7
|
+
data.tar.gz: 7f1e441d69a1b06b2f94da8a68542748ecbcb6ee21c1a91a8b9ab13aac154546998ebd9997c3c0a53b71aac4857daa1558bbe20cfd164df19e11c4150f6a32bc
|
@@ -55,6 +55,7 @@ module OmniAuth
|
|
55
55
|
option :client_auth_method
|
56
56
|
option :post_logout_redirect_uri
|
57
57
|
option :extra_authorize_params, {}
|
58
|
+
option :allow_authorize_params, []
|
58
59
|
option :uid_field, 'sub'
|
59
60
|
option :pkce, false
|
60
61
|
option :pkce_verifier, nil
|
@@ -189,6 +190,10 @@ module OmniAuth
|
|
189
190
|
session["omniauth.pkce.verifier"] = options.pkce_verifier
|
190
191
|
end
|
191
192
|
|
193
|
+
options.allow_authorize_params.each do |key|
|
194
|
+
opts[key] = request.params[key.to_s] unless opts.key?(key)
|
195
|
+
end
|
196
|
+
|
192
197
|
client.authorization_uri(opts.reject { |_k, v| v.nil? })
|
193
198
|
end
|
194
199
|
|
@@ -150,6 +150,19 @@ module OmniAuth
|
|
150
150
|
assert(strategy.authorize_uri =~ /resource=xyz/, 'URI must contain custom params')
|
151
151
|
end
|
152
152
|
|
153
|
+
def test_request_phase_with_allowed_params
|
154
|
+
strategy.options.issuer = 'example.com'
|
155
|
+
strategy.options.allow_authorize_params = [:name, :logo, :resource]
|
156
|
+
strategy.options.extra_authorize_params = {resource: 'xyz'}
|
157
|
+
strategy.options.client_options.host = 'example.com'
|
158
|
+
request.stubs(:params).returns('name' => 'example', 'logo' => 'example_logo', 'resource' => 'abc', 'not_allowed' => 'filter_me')
|
159
|
+
|
160
|
+
assert(strategy.authorize_uri =~ /resource=xyz/, 'URI must contain fixed param resource')
|
161
|
+
assert(strategy.authorize_uri =~ /name=example/, 'URI must contain dynamic param name')
|
162
|
+
assert(strategy.authorize_uri =~ /logo=example_logo/, 'URI must contain dynamic param logo')
|
163
|
+
refute(strategy.authorize_uri =~ /not_allowed=filter_me/, 'URI must filter not allowed param')
|
164
|
+
end
|
165
|
+
|
153
166
|
def test_uid
|
154
167
|
assert_equal user_info.sub, strategy.uid
|
155
168
|
|