I have had a Rails app which authenticate users with Devise. It works well.
And my next task is to build a real-time chat room. Rails doesn’t fit it, so I want to implement it on EventMachine.
But how to integrate the working devise authentication system into chat room? For example, in Rails I can get current user by simple:
current_user
How to implement it in another separate service(EM chat room in my case)? Of course, the backend of chat room can access Rails’ database.
Why do you say “Rails doesn’t fit it”? Try to keep it all under one roof. As @Bob mentioned, there are some tools that will do just that.
http://railscasts.com/episodes/316-private-pub but also
http://railscasts.com/episodes/260-messaging-with-faye
There are other ones as well that will integrate nicely with Rails. Otherwise, the question of EventMachine & Rails integration was asked before: How do EventMachine & Rails integrate?