inman has asked for the wisdom of the Perl Monks concerning the following question:

Has anyone built an LDAP server proxy using Perl? I am trying to convert information from one LDAP server into the format expected by some legacy applications. This involves responding to a bind request from a client, passing the request on to the real LDAP server (using Net::LDAP) and then converting the format of the DN returned into the legacy format. The information required for the legacy DN is stored as an attribute in the new directory.

Many thanks.

Replies are listed 'Best First'.
Re: LDAP Server proxy in Perl?
by tachyon (Chancellor) on Aug 19, 2004 at 12:04 UTC

    So what is the problem? Just set up a server to listen on (presume port 389), forward it to the real LDAP server, get the response, modify it and pass it back. Probably a job for POE::Component::Proxy::TCP but you could use IO::Socket and IO::Select if you want to go lower level. There is always Socket if you really want to get your hands dirty. With POE your code might look like:

    use POE qw(Component::Proxy::TCP); POE::Component::Proxy::TCP->new( Alias => "LDAPProxyServerSessionAlias", Port => $local_server_port, OrigPort => $remote_server_port, OrigAddress => $remote_server_host, DataFromClient => \&data_from_client_handler, DataFromServer => \&data_from_server_handler, ); sub data_from_client_handler {...} sub data_from_server_handler {...}

    cheers

    tachyon

Re: LDAP Server proxy in Perl?
by salva (Canon) on May 15, 2016 at 08:29 UTC
Re: LDAP Server proxy in Perl?
by bcarroll (Pilgrim) on May 14, 2016 at 19:15 UTC