This module is designed to act as a Basic Auth server. Active Django Users can be authenticatd against by performing requests to whereever the auth_moulde url is mounted.
For example, performing the following request will try to authenticate a user with usernme joe and password 1234.
curl -v --user "joe:1234" http://localhost:8000/
The response will either be 200 for a successful authentication or non-200 for a failed authentication.
Middleware on the client side can be designed to make this request.
IMPORTANT: because the passwords and usernames are passed in plain text, this module should ONLY be hosted under HTTPS.
This module requires: django>=1.4 django-rest-framework jsonfield
The demo directory contains an example django project.
-
Install the this package python setup.py install
-
Add the following to INSTALLED_APPS in settings.py
'rest_framework', 'auth_server',
-
Add the following to urls.conf
url(r'^$', include('auth_server.urls')),
-
Run syncdb and migrate (is south is installed)
./manage.py syncdb ./manage.py migrate auth_server
-
Create a virtualenv and activate if desired
virtualenv test_demo cd test_demo; . ./bin/activate
-
Go to the demo directory
cd auth_server/demo/
-
Install the requirements
pip install -r requirements.txt
-
Run the test
./manage.py test