mirror of
https://github.com/allankoechke/jwt-cpp.git
synced 2026-11-30 10:18:40 +00:00
🗂️ Add Conan example (#119)
* conan example added * remove cmake overhead * Update conan-example/CMakeLists.txt change cmake version Co-authored-by: Chris Mc <prince.chrismc@gmail.com> Co-authored-by: Mehmet Ali Baykara <mehmetali.baykara@encoway.de> Co-authored-by: Chris Mc <prince.chrismc@gmail.com>
This commit is contained in:
committed by
GitHub
parent
933fc1681f
commit
d2da74a80f
15
conan-example/main.cpp
Normal file
15
conan-example/main.cpp
Normal file
@@ -0,0 +1,15 @@
|
||||
#include"jwt-cpp/jwt.h"
|
||||
#include<iostream>
|
||||
#include <chrono>
|
||||
|
||||
|
||||
int main() {
|
||||
|
||||
std::string token = "eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJPbmxpbmUgSldUIEJ1aWxkZXIiLCJpYXQiOjE2MTAwMjMxNzcsImV4cCI6MTY0MTU1OTE3NywiYXVkIjoid3d3LmV4YW1wbGUuY29tIiwic3ViIjoianJvY2tldEBleGFtcGxlLmNvbSIsIkdpdmVuTmFtZSI6IkpvaG5ueSIsIlN1cm5hbWUiOiJSb2NrZXQiLCJFbWFpbCI6Impyb2NrZXRAZXhhbXBsZS5jb20iLCJSb2xlIjpbIk1hbmFnZXIiLCJQcm9qZWN0IEFkbWluaXN0cmF0b3IiXX0.5EOfHnBmpdPvRHAuVDttgJQvbFuGEF7fC4uBSXAGg6c";
|
||||
|
||||
auto decoded = jwt::decode(token);
|
||||
|
||||
for(auto& e : decoded.get_payload_claims())
|
||||
std::cout << e.first << " = " << e.second << std::endl;
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user