Code Monkey home page Code Monkey logo

Comments (7)

Thalhammer avatar Thalhammer commented on July 21, 2024

Normally they should be exactly the same.
Can you provide a test token or make sure it verifies correctly in the debugger here?

from jwt-cpp.

Rad1685 avatar Rad1685 commented on July 21, 2024

Thank you for your immediate reply. Please find the token generated in Java and C++.
“alg”: “HS512”
“name”: “Test”
secret key = “12345678901234567890”

Token generated in Java
eyJhbGciOiJIUzUxMiJ9.eyJuYW1lIjoiVGVzdCJ9.K5zOyuT9njBNWPttoQLDEKIQFaiGs4URM7vN90DXtsqL8NKIqU8UNT3RNJXCUKnaRr5hQvSvaz9huxuj8jwYlA

For the same data, the token generated in C++
eyJhbGciOiJIUzUxMiJ9.eyJuYW1lIjoiVGVzdCJ9.9LuJlX6wVlXJ8u_C3GsGyLaMiwufc17XzA-kYcbRFyeLmS4TVG2iQvw_sOpby5dOHz2sx3K2hsWHRxLaP-f1zA

Regards,
Rad

from jwt-cpp.

Thalhammer avatar Thalhammer commented on July 21, 2024

As you can check on the official jwt website, your Java token is invalid.
What library do you use in Java?

from jwt-cpp.

Rad1685 avatar Rad1685 commented on July 21, 2024

The java token gets verified successfully on checking the base64 checkbox. Also the C++ token also verifies successfully only after checking the checkbox.

from jwt-cpp.

Thalhammer avatar Thalhammer commented on July 21, 2024

No it does not. Notice that modifying the key or base checkbox changes the token.
You need to enter your key details first and then copy paste your token.
If you do that the token is invalid no matter if you check base64 or not.

from jwt-cpp.

Rad1685 avatar Rad1685 commented on July 21, 2024

Thank you very much for your inputs. As you mentioned the issue was with java API. Now signature is verified successfully.

Thanks & Regards,
Rad

from jwt-cpp.

Thalhammer avatar Thalhammer commented on July 21, 2024

No Problem.

from jwt-cpp.

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.