mirror of
https://github.com/allankoechke/jwt-cpp.git
synced 2026-11-29 09:15:53 +00:00
* use ubuntu-latest + update actions/cache * performance-avoid-endl https://clang.llvm.org/extra/clang-tidy/checks/performance/avoid-endl.html * misc-const-correctness https://clang.llvm.org/extra/clang-tidy/checks/misc/const-correctness.html * misc-const-correctness https://clang.llvm.org/extra/clang-tidy/checks/misc/const-correctness.html * formatting * clang format and tidy and already installed https://github.com/actions/runner-images/blob/main/images/ubuntu/Ubuntu2404-Readme.md#language-and-runtime * explict clang-format-14 * disable include cleaner * format * format * install lcov to get patching geninfo for gcc 13 * revert "install lcov to get patching geninfo for gcc 13"
14 lines
383 B
C++
14 lines
383 B
C++
/// @file print-claims.cpp
|
|
#include <iostream>
|
|
#include <jwt-cpp/jwt.h>
|
|
|
|
int main() {
|
|
const std::string token =
|
|
"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXUyJ9.eyJpc3MiOiJhdXRoMCIsInNhbXBsZSI6InRlc3QifQ.lQm3N2bVlqt2-"
|
|
"1L-FsOjtR6uE-L4E9zJutMWKIe1v1M";
|
|
auto decoded = jwt::decode(token);
|
|
|
|
for (auto& e : decoded.get_payload_json())
|
|
std::cout << e.first << " = " << e.second << '\n';
|
|
}
|