![]() |
Mantis App v0.1.13
|
#include <jwt.h>
Static Public Member Functions | |
static json | createJWTToken (const json &claims_params, const std::string &secretKey) |
Generate a JWT token having some custom claims. | |
static json | verifyJWTToken (const std::string &token, const std::string &secretKey) |
Verify if given token is valid and was created by us. | |
This class manages creation and verification of JWTs.
|
static |
Generate a JWT token having some custom claims.
If JWT token creation fails, the error key of the JSON response will detail the error value.
claims_params | Additional claims, for now only id and table is supported. |
secretKey | Secret key for signing the JWT tokens. |
token
and error
value. The error or token may be empty.
|
static |
Verify if given token is valid and was created by us.
If verification failed, the error JSON key of the response will have the error value. If everything went well, all the other JSON fields will be filled with extracted values.
id
, table
, verified
and error
values.