Thalhammer / jwt-cpp

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

what secret format should i use for HS512 algorithm #313

Closed quanchentg closed 8 months ago

quanchentg commented 8 months ago

What's your question?

what secret format should i use for HS512 algorithm

Additional Context

i use a base64 format as secret using HS512 to generate JWT token The jwt token can be successfully decoded as expected. but when i use auto verifierH = jwt::verify() .allow_algorithm(jwt::algorithm::hs512(jwtsecret)) .with_issuer("auth0"); verifierH.verify(decoded_token);

it always throw runtime error. do you any suggestions on that? jwtsecret is something like "dGhpc2lzc2VjcmV0c3RyaW5ndG9nZW5lcmF0ZWJhc2U2NHNlY3JldGRvbnRrbm93d2h5aXRsb25n *****" in base64 format

Thank you

quanchentg commented 8 months ago

nvm, i figure it out.