From my other sec.SE answer:
JWT are self sufficient tokens which are used to share authentication information between different systems. They solve the problem of relying on third parties for validating an authentication token as all the information required to validate the JWT is contained within the token itself. This simplifies the process of on-boarding in a single sign-on system as there is minimal integration required. JWT are also HTTP friendly as they are just BASE-64 strings.
You have not provided sufficient information about your application architecture. In your particular case it would be difficult for any other third party or a trusted resource server to validate the AES token issued by you. The only way to do this would be to share your AES encryption key with everyone who wishes to verify the authentication token issued by you. This would be a bad design decision that can have severe confidentiality and integrity issues.
Additionally, tokens need to support important security features like timestamps which allow a resource to prevent token replay attacks. Your design does not support this.
AES256.encrypt(JSON.stringify({id: 5552, admin: true}), key)
Your security token for the admin user with a unique id 5552 is always going to be the same value. In short you should not try to reinvent the wheel and rely on existing methods and frameworks for authentication. JWTs have had their share of security issues in the past. read more .