omniauth-openid-connect 0.2.1 → 0.2.2
Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 35259c91b0a952af5b6a7adf23b8f9ec8172f850
|
4
|
+
data.tar.gz: 9363495f6379fa1750ef1aae17496a87d7f41180
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e779b236142b111fd5fe2cffe5f04802e7623a59f71ca078d2ea0548b1bfe8c74f254737583940376731fc1e052ed9e875a364cb89fdfbd03b1ec5bfa6a42ea9
|
7
|
+
data.tar.gz: 5d073d720718c9445cf7adc4ce37e9bd8140b81f3abe9e5024054ac4a81f8c7022592e74f7eac97993c835f87618ca16a985f80927e144018dca21668ceeee74
|
@@ -168,22 +168,7 @@ module OmniAuth
|
|
168
168
|
end
|
169
169
|
|
170
170
|
def decode_id_token(id_token)
|
171
|
-
|
172
|
-
if header.has_key?('kid')
|
173
|
-
keys = public_key.inject({}) do |keys, jwk|
|
174
|
-
key = JSON::JWK.new(jwk)
|
175
|
-
keys.merge! jwk['kid'] => key.to_key.public_key
|
176
|
-
end
|
177
|
-
::OpenIDConnect::ResponseObject::IdToken.decode(id_token, keys[header[:kid]])
|
178
|
-
else
|
179
|
-
case public_key.class
|
180
|
-
when JSON::JWK::Set
|
181
|
-
jwk = JSON::JWK.new(public_key.first)
|
182
|
-
::OpenIDConnect::ResponseObject::IdToken.decode(id_token, jwk.to_key)
|
183
|
-
else
|
184
|
-
::OpenIDConnect::ResponseObject::IdToken.decode(id_token, public_key)
|
185
|
-
end
|
186
|
-
end
|
171
|
+
::OpenIDConnect::ResponseObject::IdToken.decode(id_token, public_key)
|
187
172
|
end
|
188
173
|
|
189
174
|
|
@@ -232,7 +217,11 @@ module OmniAuth
|
|
232
217
|
|
233
218
|
def parse_jwk_key(key)
|
234
219
|
json = JSON.parse(key)
|
235
|
-
|
220
|
+
if json.has_key?('keys')
|
221
|
+
JSON::JWK::Set.new json['keys']
|
222
|
+
else
|
223
|
+
JSON::JWK.new json
|
224
|
+
end
|
236
225
|
end
|
237
226
|
|
238
227
|
def decode(str)
|
@@ -313,13 +313,23 @@ class OmniAuth::Strategies::OpenIDConnectTest < StrategyTestCase
|
|
313
313
|
assert(strategy.send :access_token)
|
314
314
|
end
|
315
315
|
|
316
|
-
def
|
316
|
+
def test_public_key_with_jwks
|
317
317
|
strategy.options.client_signing_alg = :RS256
|
318
318
|
strategy.options.client_jwk_signing_key = File.read('./test/fixtures/jwks.json')
|
319
319
|
|
320
320
|
assert_equal JSON::JWK::Set, strategy.public_key.class
|
321
321
|
end
|
322
322
|
|
323
|
+
def test_public_key_with_jwk
|
324
|
+
strategy.options.client_signing_alg = :RS256
|
325
|
+
jwks_str = File.read('./test/fixtures/jwks.json')
|
326
|
+
jwks = JSON.parse(jwks_str)
|
327
|
+
jwk = jwks['keys'].first
|
328
|
+
strategy.options.client_jwk_signing_key = jwk.to_json
|
329
|
+
|
330
|
+
assert_equal JSON::JWK, strategy.public_key.class
|
331
|
+
end
|
332
|
+
|
323
333
|
def test_public_key_with_x509
|
324
334
|
strategy.options.client_signing_alg = :RS256
|
325
335
|
strategy.options.client_x509_signing_key = File.read('./test/fixtures/test.crt')
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: omniauth-openid-connect
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- John Bohn
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-11-
|
11
|
+
date: 2015-11-16 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: omniauth
|