views:

274

answers:

1

This probably has as much to do with rails as authlogic, but I am pretty stuck. If I use curl to request a url as follows:

curl http://neevor:l3ftcas3@localhost:3000/users/alerts/1.xml

I get the desired result. However if I try to do the same using a browser I get:

Redirected to http://192.168.0.49:3000/login
Filter chain halted as [:require_login] rendered_or_redirected.

which is the normal login page.

Thank you for any help.

+1  A: 

What browser are you using? Some browsers don't allow the username and password to be passed in a URL like that -- for example, IE has stopped allowing this. I believe FireFox disallows this as well.

Austin Mills
I have tried firefox, chrome, and safari for windows. I also created a demo app using the android sdk which uses the java HttpURLConnectionprotocol and it would not work with that either, I am very new to Java though so this might be another problem.
neevor
Never mind, you got it right on. I used String encodedAuthorization = Base64.encodeBytes(("username:password").getBytes());to handle preemptive HTTP authentication and it worked like a charm.
neevor