Need help with C++ JWT Library

Hey,

I tried all 5 libraries of the C++ for making a JWT application, and it kept saying that it’s missing a library. I am doing this on Linux ubuntu, and I don’t know what are the compilation parameters for g++. If anyone could help me and guide me through, I would appreciate it a lot.

Hey there!

Can you share with us the links to the resources you are using so we can help you troubleshoot that? Thank you!

1 Like

Hey,

Thanks for replying back. Here are the five links that I have used:

I will reply with 2 additional links because I am limited up to 3 only.

Hey, is there any update regarding this? I just need to know what library to install on my Linux, something like this:
sudo apt-get install LibraryForJWT
Also, I need to know the parameters for the g++ compiler please. Thank you!

Hey there!

Unfortunately non of those resources that you shared are official Auth0 content at the same time we don’t offer any official guidance on how to integrate C++ stack with Auth0 & Okta solutions. Maybe someone from our community will be able to help! I added a few tags to your topic for better searchability

1 Like

Oh, that’s unfortunate. I appreciate your help though, and thank you for the tags and everything, hopefully somebody happens to write something regarding this.

1 Like

Also, whoever happens to see this: How to decrypt HS256 and the links that I gave were from JWT.IO libraries.

1 Like

No worries! We’re here for you!

1 Like

Hey,

I thought it was encrpyted and a secret key was needed, the secret key was confusing me. I am just writing this so who needs it can see it.

This is to install library for linux ubuntu:

/***************************************
//JWT and Git STEP BY STEP
sudo apt-get install libssl-dev

sudo apt-get install git-all

//Install libcrypto+±dev and cmake packages
sudo apt install libcrypto+±dev cmake

//GIT
git clone GitHub - Thalhammer/jwt-cpp: A header only library for creating and validating json web tokens in c++

//Go to jwt-cpp folder
cd jwt-cpp

//Create a build directory and go to it
mkdir build && cd build

//Run cmake
cmake …

//Compile and install jwt-cpp library
make && sudo make install

*********************************************/

To decode JWT HS256:

#include <jwt-cpp/jwt.h>

auto test = jwt::decode(jwtString);
std::string result = test.get_payload();
std::cout << result << std::endl;