Looking for a good explanation for to following: Once we identify a user (by any of the safe methods) we can generate a JWT token ang give it back to the user to identify themselves for a limited time without having to re-authenticate.
How do we ensure that the correct user is using the correct token. Example, what if
user 2stole the token ofuser 1, or what isnot a userstole the token ofuser 1. Are we blindly going to trust the token? How to protect from this case?What if
user 1grabs the token and modifies it to add some extra privileges? How to protect from this case?
Let's assume token is served in a cookie and it is not httpOnly, since UI needs to read (or decode) the content to grab some of the information from it's content.