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)
317317 # done. However, if there is no kid, then we try each key
318318 # individually to see if one works:
319319 # 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 , "kid '#{ kid } ' not found"
323+ end
321324
322325 decoded = decode_with_each_key! ( id_token , keyset )
323326
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
338338 strategy . unstub ( :user_info )
339339 strategy . call! ( 'rack.session' => { 'omniauth.state' => state , 'omniauth.nonce' => nonce } )
340340
341- assert_raises JSON ::JWK ::Set ::KidNotFound do
341+ error = assert_raises JSON ::JWK ::Set ::KidNotFound do
342342 strategy . callback_phase
343343 end
344+
345+ assert_match %r{kid '.*' not found} , error . message
344346 end
345347
346348 def test_callback_phase_with_id_token_with_hs256
You can’t perform that action at this time.
0 commit comments