correcting decoded_jwt + builder api breaks

- decoded_jwt to expose get_payload_claims() and get_header_claims()
- builder set expires, not_before and issued correctly pass date as an arg
This commit is contained in:
Chris Mc
2020-07-01 17:33:42 -04:00
parent 6a41dbaf31
commit b93bdcf60b
2 changed files with 21 additions and 6 deletions

View File

@@ -46,6 +46,8 @@ YwIDAQAB
.set_type("JWT")
.set_id("rsa-create-example")
.set_issued_at(std::chrono::system_clock::now())
.set_expires_at(std::chrono::system_clock::now() + std::chrono::seconds{36000})
.set_payload_claim("sample", jwt::claim(std::string{"test"}))
.sign(jwt::algorithm::rs256(rsa_pub_key, rsa_priv_key, "", ""));
std::cout << "token:\n" << token << std::endl;