简体   繁体   中英

Authorization with Node JS application

I have an Angular 2 app with node js as back end. I am wondering, how to authenticate user when I for example want to restrict access. Now, I am using bearer token and keeping users' sessions in dictionary [token] => user object. I am not sure if this is a good solution because if someone will steal token, then could use particular users' account.

Regards

You can set expiration duration for your JWT tokens.
Avoid updating credentials(email,password etc) only on the basis of Token.
More

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM