views:

419

answers:

1

Since Rails is fully compliant with Rack I was wandering how I would set up a rackup file so that a Rails application is just a piece of middleware and then a request could hit another app further down the middleware stack.

What I really want is to use a Rails app to handle authentication and authorization for smaller rack-apps later on in the middleware stack, is this possible with Rails 3?

A: 

In rack there's a distinction between middleware and an app. You can have a whole stack of middleware, but there's only one app at the end. So you can't do exactly what you are asking.

However, you can share middleware between a rails app and other rack apps. One example of good middleware for authentication is Warden.

rsutphin