File tree Expand file tree Collapse file tree 2 files changed +7
-2
lines changed
test/lib/omniauth/strategies Expand file tree Collapse file tree 2 files changed +7
-2
lines changed Original file line number Diff line number Diff line change @@ -317,7 +317,10 @@ def decode_id_token(id_token)
317
317
# done. However, if there is no kid, then we try each key
318
318
# individually to see if one works:
319
319
# https://github.com/nov/json-jwt/pull/92#issuecomment-824654949
320
- raise if decoded &.header &.key? ( 'kid' )
320
+ if decoded &.header &.key? ( 'kid' )
321
+ kid = decoded . header [ 'kid' ]
322
+ raise JSON ::JWK ::Set ::KidNotFound . new ( "kid '#{ kid } ' not found" )
323
+ end
321
324
322
325
decoded = decode_with_each_key! ( id_token , keyset )
323
326
Original file line number Diff line number Diff line change @@ -338,9 +338,11 @@ def test_callback_phase_with_id_token_with_kid_and_no_matching_kid
338
338
strategy . unstub ( :user_info )
339
339
strategy . call! ( 'rack.session' => { 'omniauth.state' => state , 'omniauth.nonce' => nonce } )
340
340
341
- assert_raises JSON ::JWK ::Set ::KidNotFound do
341
+ error = assert_raises JSON ::JWK ::Set ::KidNotFound do
342
342
strategy . callback_phase
343
343
end
344
+
345
+ assert_match /kid '.*' not found/ , error . message
344
346
end
345
347
346
348
def test_callback_phase_with_id_token_with_hs256
You can’t perform that action at this time.
0 commit comments