socket.io JWT with PHP -


i running php website(www.mywebsite.com). add real-time chat function users can chat others.

i decided run node.js , socket.io in server separating web server(chat.mywebsite.com).

users wish use chat function have log in through www.mywebsite.com. after login, sent chat page (www.mywebsite.com/chat). on page client must post request web server jwt , use jwt authenticate in socket.io.

my question is: if jwt stolen else, , pass jwt socket.io, fake server user authenticated. approach correct or can suggest method situation? thanks!

if has access jwt token - hijacked session, https://en.wikipedia.org/wiki/session_hijacking

as long don't have xss's or other vulns on website, shouldn't should worry about.

just make sure socket.io auth user using jwt token before letting him send/recieve messages.


Comments

Popular posts from this blog

sequelize.js - Sequelize group by with association includes id -

android - Robolectric "INTERNET permission is required" -

java - Android raising EPERM (Operation not permitted) when attempting to send UDP packet after network connection -