Connector

 view release on metacpan or  search on metacpan

lib/Connector/Builtin/Authentication/LDAP.pm  view on Meta::CPAN

        my $mesg = $ldap->bind($dn, password => $password);
        if($mesg->is_error()) {
            $self->log()->debug('LDAP bind to '.$dn.' returned error code '.$mesg->code.' (error: '.$mesg->error_desc().')');
        } else {
            $self->log()->debug('LDAP bind to '.$dn.' succeeded');
            $userdn = $dn;
            last;
        }
    }

    # restore the connection using the orginal credentials
    $self->rebind();

    if(!defined $userdn) {
      $self->log()->warn('Authentication failed');
      return 0;
    } else {
      $self->log()->info('User successfuly authenticated: (dn: '.$userdn.')');
      return $userdn;
    }
}

lib/Connector/Proxy/HTTP.pm  view on Meta::CPAN


A HashRef, the key/value pairs are appended to the URI as query string.
Any values are escaped using uri_escape, keys are taken as is.

=item header

A HashRef, the key/value pairs are set as HTTP headers.

=item http_auth

A HashRef with I<user> and I<pass> used as credentials to perform a
HTTP Basic Authentication.

=item chomp_result

When working with text documents the transport layer adds a trailing
newline which might be unhandy when working with scalar values. If
set to a true value, a trailing newline will be removed by calling C<chomp>.

=item undef_on_404

lib/Connector/Proxy/Net/LDAP.pm  view on Meta::CPAN

       LOCATION  => 'ldap://localhost:389',
       base      => 'dc=example,dc=org',
       filter  => '(cn=[% ARGS.0 %])',
    });

    $conn->get('John Doe');

Above code will run a query of C<cn=test@example.org against the server>
using an anonymous bind.

=head2 using bind credentials

    my $conn = Connector::Proxy::Net::LDAP->new( {
        LOCATION  => 'ldap://localhost:389',
        base      => 'dc=example,dc=org',
        filter  => '(cn=[% ARGS.0 %])',
        binddn    => 'cn=admin,dc=openxpki,dc=org',
        password  => 'admin',
        attrs => ['usercertificate;binary','usercertificate'],
    });

Uses bind credentials and queries for entries having (at least) one of the
mentioned attributes.

=head2 connection control

Following controls are passed to Net::LDAP->new from class parameters
with the same name, see Net::LDAP for details.

=over

=item timeout



( run in 0.337 second using v1.01-cache-2.11-cpan-4d50c553e7e )