Say you want to create a token with limited rights, for example with only access to a specific small app "myapp", and with a limited view on the data, like if you had a group "mygroup" assigned (this mechanism requires to setup permissions).
And say you want this token to expire in 10 hours, for security reasons.
The python code for crafting the token (using pyjwt
library) would be:
import jwt