I am studying JSON Web Tokens, and want to try making my own authentication server (don't worry, this won't run in production anywhere). My understanding so far is this: you create a JSON string that holds all the data you want, and create a hash based on this data using a secret, which you include in the JWT as well. The secret is shared between the authentication server and the application server. The application server you send your requests to uses the same secret to recalculate the hash and compares it to that in the JWT.
Now, if for some reason your application server gets compromised and the secret comes out, you are out of luck. And you might not want your users to dissect your JWT's. So I came up with this idea:
Having the authentication server encrypt the JWT with a private key, and then having the application server decrypt it with the public key means two things: clients can't inspect the contents of their JWT's, and a comprimised application server means you still can't create fake JWT's, as the private key is not yet compromised. Decrypting with the public key also means you know the JWT is from the authentication server. As far as I can tell, encrypting with the private key and decrypting with the public one, while unusual, should not lead to weaker encryption.
My question: is there something wrong about my thinking, that could lead to this kind of authentication system not working or being easy to compromise?