You are not logged in.
I am trying my hand at writing an API in django using wapi (http://github.com/fiam/wapi).
I am using the HTTP Basic Authentication method as described in this tutorial http://fi.am/entry/building-a-website-a … a-api-aut/
I got it working and everything worked fine on my local dev environment. I have pushed it live and it seems there is a problem with the authentication - like it is not passing in the username and password I enter.
For example, I can enter https://inzolo.com/api/envelopes.xml ... if I have already logged into my site and there is a cookie stored it will return values as expected. If I am logged it it will prompt for my user name and password. I enter a correct username and password and it just keeps prompting me again again. I don't understand why it is not accepting it. Like I said, it works fine on my local dev and accepts the username and password.
Any ideas?
Offline
Been looking around and trying to load various modules in Apache mod_auth_basic, mod_authn_file, mod_authz_user, etc.
There are lots of mod_auth* modules. Do I just need to get the right combination?
Offline
I'm not familiar with WAPI basic authentication, but from what I can tell in the tutorial you mentioned, the authentication services are provided by Django (via the wapi module) so you shouldn't need to enable anything in Apache.
Offline
I couldn't figure this out so I started looking at other Django API frameworks and started reading about Piston. I noticed this line in the docs:
Note: that using piston.authentication.HttpBasicAuthentication with apache and mod_wsgi requires you to add the WSGIPassAuthorization On directive to the server or vhost config, otherwise django-piston cannot read the authentication data from HTTP_AUTHORIZATION in request.META. See: http://code.google.com/p/modwsgi/wiki/C … orization.
I thought I had found the solution, but it still doesn't seem to be passing authentication after I added WSGIPassAuthorization to my http.conf file.
Offline
Solved!
I was running Django (1.0.2)/mod_wsgi (2.0)/Python (2.5), I upgraded to Django (1.1.1)/mod_wsgi (2.5)/Python (2.5). Now, with the "WSGIPassAuthorization On" it works.
Offline