title: Sinatra Warden with existing Ruby on Rails application that uses Devise
body: <p>I am trying to split my current Ruby on Rails 3 web-application and it's web-services (API). My web-application is running on Heroku and implements API as a namespaced route within my application. For example <code>/events</code> returns a HTML page and <code>/api/v1/events</code> returns a JSON data.</p>
  
  <p>According to some <a href="https://rads.stackoverflow.com/amzn/click/com/0321659368" rel="noreferrer" rel="nofollow noreferrer">best practices</a>, I want to split those into two different applications. I have chosen Sinatra to implement the API application. It works now for simple requests where authentication is not required.</p>
  
  <p>My Ruby on Rails 3 application is using Devise to authenticate users. There's also ability to login with Facebook account. Now what I want to achieve, is HTTP Basic Authentication of users (including registration) through my Sinatra-based API by using Warden.</p>
  
  <p>What is the best way to do that? Or maybe I can use something different then Warden?</p>
  
  <p>Keep in mind that I am not very familiar with Rack :)</p>