Skip to content

JWK does not decode. #332

@rabajaj0509

Description

@rabajaj0509

while using the ruby version 2.3.5, I get this error:

2.3.5 :010 > JWT.decode(token, nil, true, { algorithms: ['RS512'], jwks: jwk_loader})
NoMethodError: undefined method `set_key' for #<OpenSSL::PKey::RSA:0x0000000001e2c9e8>
	from /home/vagrant/.rvm/gems/ruby-2.3.5/gems/jwt-2.2.1/lib/jwt/jwk/rsa.rb:40:in `import'
	from /home/vagrant/.rvm/gems/ruby-2.3.5/gems/jwt-2.2.1/lib/jwt/jwk.rb:19:in `import'
	from /home/vagrant/.rvm/gems/ruby-2.3.5/gems/jwt-2.2.1/lib/jwt/jwk/key_finder.rb:19:in `key_for'
	from /home/vagrant/.rvm/gems/ruby-2.3.5/gems/jwt-2.2.1/lib/jwt/decode.rb:37:in `verify_signature'
	from /home/vagrant/.rvm/gems/ruby-2.3.5/gems/jwt-2.2.1/lib/jwt/decode.rb:26:in `decode_segments'
	from /home/vagrant/.rvm/gems/ruby-2.3.5/gems/jwt-2.2.1/lib/jwt.rb:28:in `decode'
	from (irb):10
	from /home/vagrant/.rvm/rubies/ruby-2.3.5/bin/irb:11:in `<main>'

Can anyone please help me out with this? or can suggest me with a workaround?

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions