views:

28

answers:

1

By the way, I'm using rails 3.

How can I use devise's "warden" to authenticate a rack app in the same stack as the rails app that uses devise ?

My problem is that when I call this:

request.env['warden'] # nil :(

from the other application on the rack stack I get nil !

I integrated dav4rack (webdav) in my rails app via config.ru. I use devise for authentication in my rails app.

When I try to access the "warden" from my custom dav4rack Resource, request.env['warden'] I get nil. How can I use warden to authenticate in my dav4rack resource?

Example of config.ru I use:

http://pastie.org/1240732

A: 

In your config.ru, Your stack doesn't use warden.

If you check a request to your '/' path, you use immediatly your Rack Application in your config.ru. The warden middlkeware is add on Rails application. So like your rack application call any other rack middleware you can't to have the warden information

You need define your Rack application after the middleware warden. Because without Warden Middleware, there are no warden capability available.

shingara
1. Can you please rephrase the first phrase so it has some meaning and understandable grammar? 2. Doesn't devise, from my rails app, put warden automatically in the rack stack?
clyfe
I try to rephrase it
shingara
I solved this: http://stackoverflow.com/questions/4009082/rails-3-http-extensions-webdav-and-rack-app-mounting
clyfe