I am trying to split my current Ruby on Rails 3 web application and its web services (APIs). My web application runs on Heroku and implements the API as a route with names in my application. For example, /events returns an HTML page, and /api/v1/events returns JSON data.
According to some best practices , I want to split them into two different applications. I chose Sinatra to implement the API application. Now it works for simple queries where authentication is not required.
My Ruby on Rails 3 uses Devise to authenticate users. There is also the ability to log in with your Facebook account. Now what I want to achieve is HTTP Basic Authentication of users (including registration) through my Sinatra-based API using Warden.
What is the best way to do this? Or maybe I can use something other than Warden?
Keep in mind that I'm not very familiar with Rack :)
source share