Skip to content

Commit

Permalink
Switch to updated jwt gem API
Browse files Browse the repository at this point in the history
  • Loading branch information
nevans committed Oct 3, 2024
1 parent 5913980 commit 1fc55b5
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 11 deletions.
16 changes: 5 additions & 11 deletions lib/omniauth/strategies/yahoo_oauth2.rb
Original file line number Diff line number Diff line change
Expand Up @@ -132,17 +132,11 @@ def decode_info_token

# We have to manually verify the claims because the third parameter to
# JWT.decode is false since no verification key is provided.
::JWT::Verify.verify_claims(decoded,
verify_iss: true,
iss: options.allowed_jwt_issuers,
verify_aud: true,
aud: options.client_id,
verify_sub: false,
verify_expiration: true,
verify_not_before: true,
verify_iat: true,
verify_jti: false,
leeway: options[:jwt_leeway])
::JWT::Claims.verify_payload!(decoded,
iss: options.allowed_jwt_issuers,
aud: options.client_id,
exp: { leeway: options.jwt_leeway },
nbf: { leeway: options.jwt_leeway })

decoded
end
Expand Down
1 change: 1 addition & 0 deletions omniauth-yahoo-oauth2.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ require File.expand_path(File.join('..', 'lib', 'omniauth', 'yahoo_oauth2', 'ver
Gem::Specification.new do |gem|
gem.add_runtime_dependency 'omniauth', '>= 1.1'
gem.add_runtime_dependency 'omniauth-oauth2', '~> 1.1'
gem.add_runtime_dependency 'jwt', '>= 2.9.2'
gem.add_development_dependency 'bundler', '~> 1.0'

gem.authors = ['Amir Manji']
Expand Down

0 comments on commit 1fc55b5

Please sign in to comment.