Code Monkey home page Code Monkey logo

Comments (8)

lwe avatar lwe commented on August 27, 2024

In the meantime I've checked a few other libraries, noteably:

and they all check the issuer claim when it's present in the options.

from ruby-jwt.

excpt avatar excpt commented on August 27, 2024

This is a bug. After inspecting the code, the verification is triggered only when the iss payload is present. See: https://github.com/progrium/ruby-jwt/blob/master/lib/jwt.rb#L166

This affects also all the other verifications.

Thanks for reporting. If you find the time to provide a PR I'd be happy to merge it.

from ruby-jwt.

lwe avatar lwe commented on August 27, 2024

All right, I'd propose the following

  1. Setting verify_iss and verify_aud by default to true
  2. Change the conditions to be like if options[:verify_iss] && options["iss"]...

This change then has verification of issuer enabled - as soon as iss option is set, or would you prefer to leave verify_iss to be false by default?

PS: Btw, what is the reasoning behind using "iss" as option and not :iss?

from ruby-jwt.

excpt avatar excpt commented on August 27, 2024

I agree with your proposal. With these changes it would become more easy to setup the library and check created tokens. But this would break the current api. In this case it would be required to switch to version 2.0. I don't have a problem with this next version step.

The use of 'iss' instead of :iss was a mistake in the code review process. It simply slipped through and now it is in the current version. A fix for this could be this active support library. http://api.rubyonrails.org/classes/ActiveSupport/HashWithIndifferentAccess.html But this won't be needed if we make the version 2.0 step. In this case we can change everything to use the hash syntax and drop the ruby 1.8.x support.

from ruby-jwt.

lwe avatar lwe commented on August 27, 2024

Then I'd propose the following:

  • Bugfix release 1.5.x, where verify_iss and verify_aud are still set to to false -> will create a PR for this part
  • Breaking changes to be introduced in a 2.0 release, looking at how the current verification works, I think there are a few other areas that could be slightly adapted (similar issues, e.g. there's no way of saying: Hey, I require an exp)

from ruby-jwt.

excpt avatar excpt commented on August 27, 2024

Sounds excellent. 👍

If you have some ideas for version 2.0 send me a mail.

from ruby-jwt.

excpt avatar excpt commented on August 27, 2024

I just created a google group. https://groups.google.com/forum/#!forum/ruby-jwt Drop your ideas there. :)

from ruby-jwt.

lwe avatar lwe commented on August 27, 2024

Created a PR, so I'm closing this.

from ruby-jwt.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.