Jump to content

Authentication


deletedacc
 Share

Recommended Posts

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

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...