[Koha] LDAP authentication -- Joy!.....

Scott Owen sowen at edzone.net
Sat Oct 11 03:38:34 NZDT 2008


Hi all,

Just answering the my own issue for list(s) consumption, maybe it'll 
help someone in the future.
(since it looks like win32 users may be stuck on 2.2.9 for a while...)

I switched back to the css them (I was using the npl), and LDAP 
authentication started working MUCH more like I expected.
 
I was able to pretty much just copy the script changes from
http://wiki.koha.org/doku.php?id=ldap&s=ldap

and Ta! Da! I had working LDAP authentication
(a BIG thanks to whoever wrote and posted this script to the wiki...it 
worked perfectly!)

I made a couple modifications (see below) to allow users in different 
contexts to login.
In my case I have a O=SCHOOL and two OU's ou=students and ou=staff.


    ##################################################
    ### LOCAL
    ### Change the code below to match your own LDAP server.
    ##################################################

    # LDAP connection parameters

    # LDAP server
    my $ldapserver = '10.1.1.7';

    # Base DN for users
    my $name  = "ou=students,o=SCHOOL";
    my $name2  = "ou=staff,o=SCHOOL";

    # Bind uses the users full DN, if uid doesn't work try "cn"
    my $binddn = "cn=$userid,$name";
    my $binddn2  = "cn=$userid,$name2";

    my $db = Net::LDAP->new( $ldapserver );
   
    # do bind
    my $res =$db->bind(
            dn    =>$binddn,
            password =>$password);
   
    # do bind
    my $res =$db->bind(
            dn    =>$binddn2,
            password =>$password);   



    # check result, any other result than LDAP_SUCCESS (0)
    # is a problem
    if($res->code != 0 ) {
        # auth refused
        warn "Auth failed. LDAP server not responding or invalid 
credentials provided";











More information about the Koha mailing list