NAME

Web::Session::Store::LDAP - Use LDAP to store persistent objects

SYNOPSIS

use Web::Session::Store::LDAP;

my $store = new Web::Session::Store::LDAP;

$store->insert($ref);
$store->update($ref);
$store->materialize($ref);
$store->remove($ref);

DESCRIPTION

This module fulfills the storage interface of Apache::Session. The serialized objects are stored in an LDAP directory file using the Net::LDAP Perl module.

OPTIONS

Required: ldapServer and ldapConfBase. All others are optional.

Example:

tie %s, 'Web::Session::LDAP', undef,
   {
       ldapServer           => 'ldaps://ldap.example.com/?verify=require',
       ldapConfBase         => 'ou=sessions,dc=example,dc=com',
       ldapBindDN           => 'cn=admin,dc=example,dc=com',
       ldapBindPassword     => 'pass',
       Index                => 'uid ipAddr',
   };
ldapServer

Space or comma separated list of servers, tried in order (failover). Each entry is one of:

host[:port] | ldap://host[:port]
ldaps://host[:port][/?params]
ldap+tls://host[:port][/?params]      (StartTLS)

params is a key=value&... list of TLS options overriding the global ones for this server. Allowed keys: verify, sslversion, ciphers, clientcert, clientkey, keydecrypt, capath, cafile, checkcrl, sslserver. Other keys are ignored.

ldapConfBase

DN under which sessions are stored.

ldapBindDN, ldapBindPassword

Credentials for a simple bind. Without ldapBindDN, the connection binds with SASL EXTERNAL if it uses TLS with a client certificate, anonymously otherwise.

ldapVerify

Server certificate verification: none, optional or require (default).

ldapCAFile, ldapCAPath

CA file/directory used to verify the server certificate.

ldapClientCert, ldapClientKey

Client certificate and key (PEM) for mutual TLS. The key may be omitted if included in the certificate file. SASL EXTERNAL requires Authen::SASL.

ldapTimeout

Connection timeout (seconds).

ldapIOTimeout

Read/write timeout (seconds). Requires IO::Socket::Timeout.

ldapPort

Default port.

ldapRaw

Regex of attributes returned as raw binary (see Net::LDAP).

ldapObjectClass, ldapAttributeId, ldapAttributeContent, ldapAttributeIndex

Object class (default applicationProcess) and attributes used for the session id (cn), serialized content (description) and indexes (ou).

COPYRIGHT AND LICENSE

2009-2026 by Xavier Guimard
2013-2025 by Clément Oudot
2019-2025 by Maxime Besson
2013-2025 by Worteks
2023-2026 by Linagora
2026 by Christophe Maudoux

This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself, either Perl version 5.10.0 or, at your option, any later version of Perl 5 you may have available.

SEE ALSO

Apache::Session