Announcement Announcement Module
No announcement yet.
Spring Python and an LDAP authenticator Page Title Module
Move Remove Collapse
Conversation Detail Module
  • Filter
  • Time
  • Show
Clear All
new posts

  • Spring Python and an LDAP authenticator

    One thing I have wanted to get implemented for a long time is LDAP authentication. I already use Spring Security's LdapAuthenticator in Java. I was wanting to be able to have a similar feature in Spring Python.

    The issue is LDAP support. There seem to be two prevailing libraries out there: python-ldap and ldaptor. python-ldap is basically a wrapper around OpenLDAP's C libraries, meaning it won't work with jython. Ldaptor is a pure python library, but it is based on Twisted, requires having twisted components installed, and was abandoned about 3 years ago.

    So, scratching my head, it seems the only way to pull this off would be use conditional imports. I can code it to use python-ldap when running from CPython, and have it use something like SpringLdap's LdapTemplate when run from Jython. Python is pretty smooth at handling conditional imports. I can easily switch on an up or down vote from __import__("java"), to tell which setup I'm in.

    I would also need to code some testing. I took a peek at Spring Security's test cases, and see they use both slapd as well as Apache DS. I want the simplest way to kick off a directory server my tests can work against.