# Need help with C++ JWT Library

**URL:** <https://community.auth0.com/t/need-help-with-c-jwt-library/95185>\
**Category:** Get Help\
**Tags:** apis, application\
**Created:** [November 27, 2022, 9:40pm UTC](https://community.auth0.com/t/need-help-with-c-jwt-library/95185 "2022-11-27T21:40:12Z")\
**Posts on this page:** 11\
**Page:** 1

<div class="post-metadata">

**Author:** ![renekthrope](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/renekthrope/32/33935_2.png) [@renekthrope](https://community.auth0.com/u/renekthrope)\
**Post date:** [November 27, 2022, 9:40pm UTC](https://community.auth0.com/t/need-help-with-c-jwt-library/95185/1 "2022-11-27T21:40:12Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![konrad.sopala](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/konrad.sopala/32/13516_2.png) [@konrad.sopala](https://community.auth0.com/u/konrad.sopala)\
**Post date:** [November 28, 2022, 9:41am UTC](https://community.auth0.com/t/need-help-with-c-jwt-library/95185/2 "2022-11-28T09:41:07Z")

</div>

Hey there!

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

---

<div class="post-metadata">

**Author:** ![renekthrope](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/renekthrope/32/33935_2.png) [@renekthrope](https://community.auth0.com/u/renekthrope)\
**Post date:** [November 28, 2022, 10:56pm UTC](https://community.auth0.com/t/need-help-with-c-jwt-library/95185/3 "2022-11-28T22:56:48Z")

</div>

Hey,

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

> **[GitHub - troian/jwtpp: JSON Object Signing and Encryption library for C++.](https://github.com/troian/jwtpp)**
>
> JSON Object Signing and Encryption library for C++. - GitHub - troian/jwtpp: JSON Object Signing and Encryption library for C++.

> **[GitHub - Thalhammer/jwt-cpp: A header only library for creating and...](https://github.com/Thalhammer/jwt-cpp)**
>
> A header only library for creating and validating json web tokens in c++ - GitHub - Thalhammer/jwt-cpp: A header only library for creating and validating json web tokens in c++

> **[GitHub - arun11299/cpp-jwt: JSON Web Token library for C++](https://github.com/arun11299/cpp-jwt)**
>
> JSON Web Token library for C++. Contribute to arun11299/cpp-jwt development by creating an account on GitHub.

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

---

<div class="post-metadata">

**Author:** ![renekthrope](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/renekthrope/32/33935_2.png) [@renekthrope](https://community.auth0.com/u/renekthrope)\
**Post date:** [November 28, 2022, 10:57pm UTC](https://community.auth0.com/t/need-help-with-c-jwt-library/95185/4 "2022-11-28T22:57:24Z")

</div>

> **[GitHub - pokowaka/jwt-cpp: A C++ library for handling JWT tokens](https://github.com/pokowaka/jwt-cpp)**
>
> A C++ library for handling JWT tokens. Contribute to pokowaka/jwt-cpp development by creating an account on GitHub.

> **[GitHub - pocoproject/poco: The POCO C++ Libraries are powerful cross-platform...](https://github.com/pocoproject/poco)**
>
> The POCO C++ Libraries are powerful cross-platform C++ libraries for building network- and internet-based applications that run on desktop, server, mobile, IoT, and embedded systems. - GitHub - poc...

---

<div class="post-metadata">

**Author:** ![renekthrope](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/renekthrope/32/33935_2.png) [@renekthrope](https://community.auth0.com/u/renekthrope)\
**Post date:** [December 3, 2022, 1:09am UTC](https://community.auth0.com/t/need-help-with-c-jwt-library/95185/5 "2022-12-03T01:09:54Z")

</div>

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!

---

<div class="post-metadata">

**Author:** ![konrad.sopala](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/konrad.sopala/32/13516_2.png) [@konrad.sopala](https://community.auth0.com/u/konrad.sopala)\
**Post date:** [December 5, 2022, 9:11am UTC](https://community.auth0.com/t/need-help-with-c-jwt-library/95185/6 "2022-12-05T09:11:21Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![renekthrope](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/renekthrope/32/33935_2.png) [@renekthrope](https://community.auth0.com/u/renekthrope)\
**Post date:** [December 6, 2022, 12:03am UTC](https://community.auth0.com/t/need-help-with-c-jwt-library/95185/7 "2022-12-06T00:03:57Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![renekthrope](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/renekthrope/32/33935_2.png) [@renekthrope](https://community.auth0.com/u/renekthrope)\
**Post date:** [December 6, 2022, 1:04am UTC](https://community.auth0.com/t/need-help-with-c-jwt-library/95185/8 "2022-12-06T01:04:44Z")

</div>

Also, whoever happens to see this: How to decrypt **HS256** and the links that I gave were from [JWT.IO](http://JWT.IO) libraries.

---

<div class="post-metadata">

**Author:** ![konrad.sopala](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/konrad.sopala/32/13516_2.png) [@konrad.sopala](https://community.auth0.com/u/konrad.sopala)\
**Post date:** [December 6, 2022, 11:14am UTC](https://community.auth0.com/t/need-help-with-c-jwt-library/95185/9 "2022-12-06T11:14:49Z")

</div>

No worries! We’re here for you!

---

<div class="post-metadata">

**Author:** ![renekthrope](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/renekthrope/32/33935_2.png) [@renekthrope](https://community.auth0.com/u/renekthrope)\
**Post date:** [December 16, 2022, 8:11pm UTC](https://community.auth0.com/t/need-help-with-c-jwt-library/95185/10 "2022-12-16T20:11:49Z")

</div>

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++](https://github.com/Thalhammer/jwt-cpp.git)
> 
> //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;

---

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/auth0/original/3X/b/5/b560f266932fcce5d57f09a6595bd50518cae3f3.jpeg) [@system](https://community.auth0.com/u/system)\
**Post date:** [November 14, 2024, 10:46pm UTC](https://community.auth0.com/t/need-help-with-c-jwt-library/95185/11 "2024-11-14T22:46:23Z")

</div>

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.
