File: print-claims.cpp

package info (click to toggle)
scitokens-cpp 1.1.3-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 1,988 kB
  • sloc: cpp: 25,363; makefile: 14
file content (11 lines) | stat: -rw-r--r-- 330 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
#include <iostream>
#include <jwt-cpp/jwt.h>

int main() {
	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 << std::endl;
}