NAME

LibreCat::Auth::LDAP - A LibreCat LDAP authentication package

SYNOPSIS

    use LibreCat::Auth::LDAP;

    my $auth = LibreCat::Auth::LDAP->new(
        host => 'ldaps://ldaps.ugent.be'
        auth_base => 'ugentID=%s,ou=people,dc=UGent,dc=be'
    );

    if ($auth->authenticate({username => $username,
            password => $password})) {
        say "logged in";
    }
    else {
        say "error";
    }

CONFIG

host

The URL to the LDAP server. Use ldaps:// for a secure connection. Required

auth_base

The base to use when authenticating user credentials. Required

base

When a double binding is required, the the bind parameters before checking user credentials.

password

An optional password required when doing a double binding.

search_filter

Some LDAP servers may require you to lookup a user identifier. Set a search filter to lookup a user. E.g.

     search_filter => '(uid=%s)'

search_base

The base to search with a search_filter. E.g.

     search_base => 'dc=ugent, dc=be'

search_attr

The attribute to return from a search filter. E.g.

     search_attr: 'ugentID'

In the examples above a user name like 'einstein' will be searched as (uid=einstein) in the base 'dc=ugent, dc=be'. When a search result is found, then the login name will be translated to the 'ugentID' of the user.

SEE ALSO

LibreCat::Auth