Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

JTI claim broken? #152

Closed
estiens opened this issue Jun 7, 2016 · 2 comments
Closed

JTI claim broken? #152

estiens opened this issue Jun 7, 2016 · 2 comments
Labels
Milestone

Comments

@estiens
Copy link

estiens commented Jun 7, 2016

This example code from the docs throws an error

iat = Time.now.to_i
hmac_secret = 'test'
jti_raw = [hmac_secret, iat].join(':').to_s
jti = Digest::MD5.hexdigest(jti_raw)
jti_payload = { :data => 'data', :iat => iat, :jti => jti }

token = JWT.encode jti_payload, hmac_secret, 'HS256'

decoded_token = JWT.decode token, hmac_secret, true, { :verify_jti => true, :algorithm => 'HS256' }

throws JWT::InvalidJtiError: Not a uniq jwt id

@excpt excpt added the bug label Jul 30, 2016
@excpt
Copy link
Member

excpt commented Aug 23, 2016

Hi @estiens ,

can you please check this again using the current master branch?

This seems to be fixed now.

@excpt excpt added this to the Version 1.5.5 milestone Aug 23, 2016
@estiens
Copy link
Author

estiens commented Aug 23, 2016

Works for me on current master branch 👍

@excpt excpt closed this as completed Aug 23, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants