Is setting Roles in JWT a best practice?
问题 I am considering to use JWT. In the jwt.io example I am seeing the following information in the payload data: "admin": true Admin can be considered as a Role, hence my question. Is setting the role in the token payload a habitual/good practice? Given that roles can be dynamically modified, I'm quite interrogative. 回答1: Nothing stops you from creating claims to store extra information in your token if they can be useful for your client. However I would rely on JWT only for authentication (who