Thalhammer / jwt-cpp

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

Example of basic claims #232

Closed enriavil1 closed 2 years ago

enriavil1 commented 2 years ago

What's your question?

Could I receive examples of verifying a jwt decoded token with a basic claim

Additional Context

I receive a jwt encoded token, so I decoded and create a verifier. I want to check some basic claims when verifying the decoded token.

prince-chrismc commented 2 years ago

The verifier has a ton of built-in support for the standard claims.

If you need an exact match you can check out

https://github.com/Thalhammer/jwt-cpp/blob/5d25462e030fa20a7d7e35f5ba70c6ebb61cb1b6/example/private-claims.cpp#L42

But if you need a custom verifier I just added a new example

https://github.com/Thalhammer/jwt-cpp/blob/5d25462e030fa20a7d7e35f5ba70c6ebb61cb1b6/example/partial-claim-verifier.cpp#L80

Hopefully that helps!

enriavil1 commented 2 years ago

Perfect this is what I mean. Thank you!