Reputation: 2064
I am going through various javascript/auth tutorials -- I understand salting password and storing it in the DB, using Passport, generating the token and storing it in the request header, etc. Overall, I got the whole flow going -- for signing up and signing in. But I am not sure why the following is not being mentioned in any of the tutorials: if I can view http traffic on the network, cant I steal someone else's token and "impersonate" that user? I wont be able to decrypt the token since I dont have the "secret phrase" used to generate the token, but I can surely take it "as is"? So, do tokens and https go together? Is my understanding about user impersonation via a token correct? Thank you
Upvotes: 0
Views: 21
Reputation:
As somebody who intercepts a JWT you ...
So, yes, use HTTPS.
Also on the server side don't rely on the JWT alone. Check that ...
Upvotes: 1