This article on JWT is super clear except for the last part.
Parts I understand: 1. Encoding is diff from encryption. 2. The token's parts (header base64 encoded, payload base64 encoded, signature which header+payload encrypted with the public key and a specified algo)
But I don't understand how the token verification is handled in part 5. I also don't understand why the header and the payload need to be Base64 encoded. Given that it's not secure or encrypted... what's the part of the encoding?
*****EDIT****
Am I right in understanding that since the JWT contains an encoded header and payload... the application server can just use its secret key (perhaps a public key in an asymmetric encryption mechanism) to encrypt the included payload and header and if it arrives at the same included JWT signature... then the application server knows that the data hasn't been tampered with and the user did indeed authenticate with the authentication server. Is this right?
If the signatures don't match. What does this imply?