Thalhammer / jwt-cpp

A header only library for creating and validating json web tokens in c++
https://thalhammer.github.io/jwt-cpp/
MIT License
899 stars 242 forks source link

Rework verifier checks #148

Closed Thalhammer closed 3 years ago

Thalhammer commented 3 years ago

Reworked the verifier core to allow more flexibility when checking. This also removes the special cases for nbf, iat, exp and aud.

Basically I replaced the exact matching against a single value with a more flexible callback for each claim that gets passed some context and can return error codes in case they don't verify correctly. This allows for way more flexible checks like doing deep checks of objects or case insensitive checks.

This is not a final proposal, but more like a proof of the idea. I am absolutely open to improvements/changes even if they completely restructure this.

prince-chrismc commented 3 years ago

The only comment left for me is https://github.com/Thalhammer/jwt-cpp/pull/148#discussion_r663287108, I'd like to see that added in, otherwise...

LGTM 🚀