A very simple MAC token implementation that lacks the following capabilities:
- Some degree of replay protection
- Revocation of issuance (via blacklist/JTI)
- Opaque payload (custom parts can still be opaque as long as they are encrypted before being passed in)
- Separation of issuance and verification
It uses the HS256 algorithm, with the user providing the SECRET. The payload includes a field for optional custom data ( requiring implementation of Serialize+Deserialize). It provides basic functions such as encoding, decoding, and refreshing.
refer to unit_test