-
-
Notifications
You must be signed in to change notification settings - Fork 246
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Decode JWT Token (Boost) #248
Comments
Hmm I am not able to repoduce 🤔 Want to try my code? |
I solved it. The problem existed because my string (text) have white characters.
|
Glad to hear you solved your issue. jwt-cpp expects a clean token as a parameter, not sure if we should check for preceding/trailing whitespace and remove it. What do you think @prince-chrismc ? |
@Thalhammer @prince-chrismc This problem was very difficult to detect. Because prints were the same. But strings weren't been the same. My string has a lot of white characters inside (Not only on end and begin). I have a new problem with I would like print all claims.
I can't find test/example for this Error:
Can you help me? |
The boost library has a funky implementation which the library does not support for the "key value pairs"... You should be able to covert the object maps to JSON as a workaround. Line 2333 in 0628011
Sadly I am traveling so I can not write any code to show that |
I think the head of the problem is the error message. When it said it should say |
I opened a PR to that it will be easier to print the claims for Boost. #251 I would also like to break a separate issue for having more feedback in the errors of base64 decoding, is that good for everyone? |
What's your question?
How to decode JWT token (HS256) with Boost traits?
Additional Context
Hello.
I have a token generated by https://jwt.io but I have a problem - Exception: Invalid input: not within alphabet.
How to fix it?
Encoded:
Header:
Payload:
VERIFY SIGNATURE:
Code:
Error log:
The text was updated successfully, but these errors were encountered: