Personal tools
You are here: Home Plone XP leocornus.django.ploneproxy Ability to Authenticate Plone User Account

Ability to Authenticate Plone User Account

— filed under: , ,

In one word, we could verify the user credentials based on user account on Plone site.  This requires 2 steps:

  1. mod_wsgi for the proxy httpd server
  2. django authentication

mod_wsgi Authentication

How WSGI process user authentication?

How WSGI authentication associated with the httpd's proxy location?

Django Authentication Backend

We could easily change the authentication backend for a django application.  It is configured in file settings.py under variable AUTHENTICATION_BACKENDS.  Its value is tuple, you could list all available backends here.  Django authentication process will stop at the first positive match.  The default value is set to ('django.contrib.auth.bakends.ModelBackend',).

Leverage on httplib2

Depends on httplib2 to authenticate user in backend.

  • build the login URL based on user's request. Plone site's login_form is working for most of objects but may not work for some views, such as view, folder_contents.
  • prepare the headers and login_forms as dicts:
    - headers User-Agent must by some real browser, otherwise the cookie will be considered as disabled. 
    - must use special header to let PythonAuthenHandler to bypass the login request.
  • post the login_form to the login_url.

Tracking History

When Who What Done
2010-06-08 10:41 Sean Chen build the login_url from the next Request param, so we will use the exact Plone site to verify user's credentials. Revision r435
-- 1.0 Hours, 100.0% Done
2010-06-08 07:28 Sean Chen Code finished and tested, story is completed.
-- 5.0 Hours, 100.0% Done
Document Actions