Perl

NAVIGATION
CATEGORIES
REFERRENCE
LINKS
  • Authen::SASL::Perl::GSSAPI documentaion: Codeexample

    0 answers - 1450 bytes - related search similar search Add To My Delicious Add To My Stumble Upon Add To My Google Mark Add To My Facebook Add To My Digg Add To My Reddit

    Hello,
    From my pint of view the PD of Authen::SASL::Perl::GSSAPI
    is missing a codeexample that demonstrates how to use the
    Authen::SASL::Perl::GSSAPI module.
    I promised to send Code, here is an example that's used
    with Net::LDAP and makes use of the new error() Method.
    So the user has a chance to see from ducumentation how to
    get helpful errormessages (from the underlying Kerberossystem).
    What do you think of adding that codesnippet to the PD
    of Authen::SASL::Perl::GSSAPI?
    Thank you,
    Achim
    #! /usr/bin/perl -w
    use strict;
    use Net::LDAP 0.33;
    use Authen::SASL 2.10;
    # Adjust to your environment
    my $adhost = 'theserver.bla.net';
    my $ldap_base = 'dc=bla,dc=net';
    my $ldap_filter = '(&(sAMAccountName=BLAAGRL))';
    my $sasl = Authen::SASL->new( mechanism ='GSSAPI' );
    my $ldap;
    eval {
    $ldap = Net::LDAP->new( $adhost,
    onerror ='die',
    ) or die "Cannot connect to LDAP host '$adhost':
    '$@'";
    $ldap->bind( sasl =$sasl );
    };
    if ($@) {
    chomp $@;
    die "\nBind error : $@",
    "\nDetailed SASL error: ", $sasl->error,
    "\nTerminated";
    }
    print "\nLDAP bind() succeeded, working in authenticated state";
    my $mesg = $ldap->search( base =$ldap_base,
    filter =$ldap_filter );
    # evaluate $mesg

Re: Authen::SASL::Perl::GSSAPI documentaion: Codeexample


max 4000 letters.
Your nickname that display:
In order to stop the spam: 3 + 2 =
QUESTION ON "Perl"

EMSDN.COM