[Twisted-Python] Using ldapbindingchecker (part of ldaptor) with Twisted.
I am looking for any examples of using the ldapbindingchecker to authenticate a custom SSH Server written with Twisted and Python 2.7. At the moment I am trying to hack an existing SSHD example in the Twisted O'Reilly book. The docs refer to a "cfg" but I cannot find where it discusses what CFG actually is ? I seem to need a service account to authenticate with the ldapbindingchecker so I can decide my user accound and password are valid over ldap. Where is this defined and what is the format ? I have found the global.cfg file and that gets me part of the way there but effectively I still cannot set a password. Can anyone help ? Many thanks, David Shepherd Solutions Architect (Collaboration) Novell Services Tel: +44 (0)1344 724000 e-mail: dshepherd@novell.com For information on Novell Services go to: www.novell.com/services/demo.html Novell UK Ltd 1 Arlington Square Bracknell Berkshire RG121WA
On Wed, Feb 4, 2015 at 2:46 PM, David Shepherd
I am looking for any examples of using the ldapbindingchecker to authenticate a custom SSH Server written with Twisted and Python 2.7. At the moment I am trying to hack an existing SSHD example in the Twisted O'Reilly book. The docs refer to a "cfg" but I cannot find where it discusses what CFG actually is ?
I've yet to really dig into the code in that area of Ldaptor yet, but I believe this might be what you want: ldapChecker = LDAPBindingChecker(ldaptor.config.LDAPConfig()) p.registerChecker(ldapChecker) or cfg = LDAPConfig() checker = LDAPBindingChecker(cfg) realm = TODOGetRidOfMeRealm(config=cfg) porta = portal.Portal(realm) porta.registerChecker(checkers.AllowAnonymousAccess(), credentials.IAnonymous) porta.registerChecker(checker)
I seem to need a service account to authenticate with the ldapbindingchecker so I can decide my user accound and password are valid over ldap. Where is this defined and what is the format ? I have found the global.cfg file and that gets me part of the way there but effectively I still cannot set a password. Can anyone help ?
Looking here: http://ldaptor.readthedocs.org/en/latest/_modules/ldaptor/checkers.html seems to indicate that you need to pass in your credentials. There are a few TODO items in here as well.
I hope this gets you started into a better direction! I hope there are others that can chime in as well Cheers, Bret references: https://twistedmatrix.com/pipermail/twisted-python/2005-November/011928.html https://searchcode.com/codesearch/view/15584430/
participants (2)
-
bret curtis
-
David Shepherd