Comments (7)
Currently the only documentation are the example in README.md and the various testcases in *Test.cpp
from jwt-cpp.
:(
from jwt-cpp.
I almost forgot about it, but most of the methods are commented with doxygen comments and there is a doxygen config in the root. It's not really a complete documentation, but it might help.
from jwt-cpp.
Hello Thalhammer,
I have seen on several sites about the header "typ" parameter that must be configured as JWT.
For example: "typ" : "JWT"
But on RFC says:
"The "typ" (type) Header Parameter defined by [JWS] and [JWE] is used
by JWT applications" and " If present, it is RECOMMENDED that
its value be "JWT" to indicate that this object is a JWT."
In your examples you use "typ" : "JWS".
What would be the difference? What would be the correct use?
Thanks.
Best Regards
Paulo
from jwt-cpp.
@paulotovo According to the rfc that part is optional and should not be used by the jwt library.
It defines the media type and could be used to disabiguate if you expect not only jwt tokens to hit your app. JWT stands for Json Web Tokens and JWS for Json Web Signature which is a different, but very similar rfc. In 99% of cases it does not matter and the reason my test token uses JWS is simply a coincidence.
from jwt-cpp.
Continuing with the theme of API documentation/examples, the example given shows get_payload_claims() in this context:
std::string token = "eyJhbGciOiJIUzI1...OkEE";
auto decoded = jwt::decode(token);
for( auto& e : decoded.get_payload_claims() )
std::cout << e.first << " = " << e.second.to_json() << std::endl;
but, I don't find any definition of get_payload_claims() in class jwt::decoded_jwt<jwt::picojson_traits>
or otherwise...
What am I missing here?
Thanks,
from jwt-cpp.
The current master is a getting ready for an release candidate, and rightfully so because it seem like get_payload_claims
got removed during #71 by accident 😨
I would strongly recommend using the v0.4.0 release while the last few details get ironed out. ( I am using that in production code ) The method in question is available there.
Line 1027 in 34bb064
Sorry for the inconvience!
from jwt-cpp.
Related Issues (20)
- x86/Win32 compilation and using boost json HOT 2
- Private Key Signing vs Signing from Service Account file HOT 5
- undefined reference error in compiling HOT 9
- what secret format should i use for HS512 algorithm HOT 1
- Release status of 0.7.0-rc.0 HOT 3
- Guide to Setting Up jwt-cpp? HOT 4
- Building example: no matching function for call to ‘decode(std::string&)’ HOT 1
- Compilation error: no matching function for call to ‘decode(std::string&)’ HOT 2
- Build Errors For picojson.h? HOT 8
- Getting Error - namespace "jwt" has no member "claims" HOT 6
- Unable to generate token using ed25519 HOT 2
- Use of Builder explicitly
- Need help : How to Implement JWT Operations from Python Using jwt-cpp ? HOT 5
- How to use payload and get the payload data HOT 7
- Boost JSON traits kind of buggy HOT 5
- How to verify a jwt HOT 3
- Invalid input: not within alphabet HOT 6
- Locking in libcrypto in multi threaded app HOT 6
- Linker error for OpenSSL on Windows HOT 5
- Exception is thrown with the exmple private-claims.cpp HOT 10
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from jwt-cpp.