nov / json-jwt

JSON Web Token and its family (JSON Web Signature, JSON Web Encryption and JSON Web Key) in Ruby
MIT License
299 stars 81 forks source link

Header params overwritten when signing #37

Closed economou closed 8 years ago

economou commented 8 years ago

Hello,

I've been using this gem in combination with your OpenIDConnect gem. When converting an IdToken to JWT, I've been setting some header parameters like so:

claims = { ... }
id_token = OpenIDConnect::ResponseObject::IdToken.new(claims)
signing_key = '...'

jwt = id_token.to_jwt(signing_key) do |token|
  token.x5u = 'http://www.example.com/'
end

However, when upgrading the JSON::JWT gem from version 1.5 to 1.6, I have unit tests failing due to these header parameters being lost.

This is apparently caused by this change: calling dup here doesn't copy over the header data to the new object.