you should have a look at JSON Web Token http://jwt.io/
In the examples in the article, the JWT header is just plain cruft because you're unlikely to be switching encoding often (and if you decide to, including a single much shorter token as a "stand-in" for the bloated JSON data would be much better; using JSON).
The payload also represents a lot of extra overhead unless you intend to transfer more than just a single level dictionary.
It's kind of comical that they present it as "compact" given that probably something like 30% of the length of the presented example is unnecessary.