The London Perl and Raku Workshop takes place on 26th Oct 2024. If your company depends on Perl, please consider sponsoring and/or attending.

NAME

Quiq::Ldap::Client - LDAP Client

BASE CLASS

Quiq::Hash

DESCRIPTION

Ein Objekt der Klasse repräsentiert einen LDAP-Client. Die Klasse stellt eine Überdeckung der Klasse Net::LDAP dar, mit dem Vorteil, dass keine Fehlerbehandlung nötig ist, sondern im Fehlerfall eine Exception geworfen wird.

LDAP Test Zeppelin: /usr/local/bin/test_ldap_zeppelin.sh

Homepage: Net::LDAP

EXAMPLE

  # The following example shows how to use the Class
  # to query the RootDSE of Acctive Directory
  
  my $ldap = Quiq::Ldap::Client->new('dc1');
  my $res = $ldap->search(
      base => '',
      filter => '(objectclass=*)',
      scope  => 'base',
  );
  for my $ent ($res->entries) {
      for my $key (sort $ent->attributes) {
          print "$key:";
          for my $val ($ent->get($key)) {
              print " $val";
          }
          print "\n";
      }
  }

METHODS

Konstruktor

new() - Instantiiere Objekt

Synopsis

  $ldap = $class->new($uri,%options);

Arguments

$uri

URI des LDAP-Servers. Siehe Net::LDAP.

%options

Optionen als Schlüssel/Wert-Paare. Siehe Net::LDAP.

Returns

Object

Description

Instantiiere eine Objekt der Klasse und liefere eine Referenz auf dieses Objekt zurück.

Example

  • LDAP

      $ldap = Quiq::Ldap::Client->new(
          'ldap://dc1',
          debug => 12,
      );
  • LDAPS

      $ldap = Quiq::Ldap::Client->new(
          'ldaps://dc1',
          verify => 'none',
          debug => 12,
      );

Objektmethoden

bind() - Login auf LDAP-Server

Synopsis

  $ldap->bind;               # anonymous
  $ldap->bind($dn,%options);

Arguments

$dn

DN, mit der gebunden wird.

%options

Optionen als Schlüssel/Wert-Paare. Siehe Net::LDAP.

Description

Logge User auf LDAP-Server ein.

search() - Durchsuche Server

Synopsis

  $ldap->search(%options);

Arguments

%options

Optionen als Schlüssel/Wert-Paare. Siehe Net::LDAP.

Description

Durchsuche den LDAP-Server durch Anwendung eines Filters.

startTls() - Wandele Verbindung nach TLS

Synopsis

  $ldap->startTls(%options);

Arguments

%options

Optionen als Schlüssel/Wert-Paare. Siehe Net::LDAP.

Description

Wandele Verbindung nach TLS

unbind() - Trenne Verbindung

Synopsis

  $ldap->unbind;

Description

Trenne die Verbindung zum LDAP-Server.

VERSION

1.207

AUTHOR

Frank Seitz, http://fseitz.de/

COPYRIGHT

Copyright (C) 2023 Frank Seitz

LICENSE

This code is free software; you can redistribute it and/or modify it under the same terms as Perl itself.