mirror of
https://github.com/allankoechke/jwt-cpp.git
synced 2026-11-30 10:18:40 +00:00
11 lines
364 B
C++
11 lines
364 B
C++
#include <jwt-cpp/jwt.h>
|
|
#include <iostream>
|
|
|
|
int main(int argc, const char** argv) {
|
|
std::string token = "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXUyJ9.eyJpc3MiOiJhdXRoMCJ9.AbIJTDMFc7yUa5MhvcP03nJPyCPzZtQcGEp-zWfOkEE";
|
|
auto decoded = jwt::decode(token);
|
|
|
|
for(auto& e : decoded.get_payload_claims())
|
|
std::cout << e.first << " = " << e.second.to_json() << std::endl;
|
|
}
|