Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Rails, Node.js cross-server authentication

So I'm making a rails app that also utilizes node.js for realtime features. What is the best way to authenticate the users on the node app, if they were created with devise on rails? I've been thinking about saving the session id in the db, and then validating with that, or maybe displaying the user id in the page and then sending that to the node app when they connect. Or maybe something else entirely would be best. I'm using mongoose for my node orm and mongoid for ruby.

like image 761
JRPete Avatar asked May 15 '11 19:05

JRPete


1 Answers

Storing the session id in your database is a valid approach, I do that in my own applications.

like image 191
mikerobi Avatar answered Oct 16 '22 04:10

mikerobi