DEV Community

Discussion on: What really is the difference between session and token based authentication

Collapse
 
aderchox profile image
aderchox

how do we know the jwt received is right if we don't store it on the server side ? Do we encrypt it with our own private keys and decrypt them back afterwards?

Collapse
 
chandelieraxel profile image
Chandelier Axel

Hey ! Pretty much, yes. Basically, once the server create the JWT, it'll "sign" it with a secured secret (an overcomplicated string, most likely). When your client send the JWT with the request, the server will "verify" the token, using the secret key you used to sign it.