deletedacc Posted May 25, 2015 Share Posted May 25, 2015 Hi Guys, Is there any topics, or could any of you shed some light for the following example. Say I had an RPG written in JS/Html5 with Socket.io as networking. How would I per say Authenticate the user, For example, Session control between PHP and Node itself so I could see whos just connected to the client and thus pull their data from something such as Mongo DB. Cheers,Alex Quote Link to comment Share on other sites More sharing options...
mfdesigner Posted May 31, 2015 Share Posted May 31, 2015 One way is to use a registration process to establish a shared secret between a user and your database beforehand. And later uses a Proof-of-Possession scheme to show that a user has that shared secret in possession ( e.g. a password ). Quote Link to comment Share on other sites More sharing options...
deletedacc Posted June 1, 2015 Author Share Posted June 1, 2015 One way is to use a registration process to establish a shared secret between a user and your database beforehand. And later uses a Proof-of-Possession scheme to show that a user has that shared secret in possession ( e.g. a password ). So for example, construct some session that I store in a database that the server could connect to.. Ie combination of last login time, ip logged into, browser used etc. Hashed or something. that then the user submits onConnect, and likewise the server looks it up and works it out for themselves? Alex Quote Link to comment Share on other sites More sharing options...
Gio Posted June 3, 2015 Share Posted June 3, 2015 I don't see why you need PHP in all this. If you're running a Node server, do your authentication in Node directly. You can have proper sessions with cookies and all that (which is a bit of a pain but easier if you're using express), or just generate an authentication token, store it on MongoDB and send it to the client after a successful login. Then the client sends this token along with every request they want to make to your server. Quote Link to comment Share on other sites More sharing options...
deletedacc Posted June 9, 2015 Author Share Posted June 9, 2015 I don't see why you need PHP in all this. If you're running a Node server, do your authentication in Node directly. You can have proper sessions with cookies and all that (which is a bit of a pain but easier if you're using express), or just generate an authentication token, store it on MongoDB and send it to the client after a successful login. Then the client sends this token along with every request they want to make to your server. Didn't think of this lol. I can keep the game and site interfaces separate. I did want to separate the databases, i.e. users on mySQL and game / character data on a noSQL platform Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.