I'm trying to understand how to use JWTs and more specifically, how not to use them.
Lets say I have a service that lets a user log in with a user name and password and I generate a JWT in response.
Next, the client passes this JWT as part of a request to my API that is located in a separate service. This service can verify that the signature is correct, whiteout knowing the secret key that was used to sign it with. It can also extract the claims.
But what's stopping a malicious user from just generating a JWT using any random secret key for signing, and modifying the claims?
The JWT below is signed using the key "my_super_Secret_key", not the original key that was used by my Identity service. I also changed my username to admin. When my service receives this JWT, it will see that it has a verifiable signature and happily extract the claims.
Should all incoming requests have the JWT verified against the secret key that was used to generate it?