I have an existing third-party PHP Web Application (ELGG) that I would like to extend with a Node.js Application. Users are authenticated in the PHP app by checking their provided credentials against a MySQL database.
How can I secure access to the Node.js app without having to rewrite authentication code in Node? Is there some way to allow users to access the Node.js app only if they're logged in to the PHP app?
You could use a DB or some other shared repository to store the users session id, which Node can check to ensure the user is logged in.