what i am doing wrong here .. getting LDAP_STRONG_AUTH_NOT_SUPPORTED

Discussion in 'Perl Misc' started by Durairaj Avasi, Apr 8, 2004.

  1. When i bind like the following code.. i am getting
    LDAP_STRONG_AUTH_NOT_SUPPORTED

    if i connect with normal bind without Authen::SASL and $sasl i am
    getting LDAP_STRONG_AUTH_REQUIRED error..

    what i am doing wrong here... why this drives so grazy...

    ldap gurus... help me out.

    use Net::LDAP qw(LDAP_SUCCESS LDAP_PROTOCOL_ERROR);
    use Authen::SASL;
    use Net::LDAP::Util qw(ldap_error_name ldap_error_text);

    sub lConnect {
    my $server = shift;
    print " the server name is $server\n";
    my $ldap = Net::LDAP->new($server, port=> 389, version => 3);
    print "=== The error is $@ <====\n";
    return($ldap);
    }

    my $ldap = &lConnect('$myserver');
    my $sasl = Authen::SASL->new(mechanism => 'CRAM-MD5',password =>
    'Abcd1234$');
    my $isBinded = $ldap->bind ('CN=Durairaj
    Avasi,OU=ITDEV2,DC=webdurai,DC=com', sasl => $sasl, version => 3);
    print "ERROR detected: -> ", ldap_error_name($isBinded->code), " ",
    ldap_error_text($isBinded->code) if($isBinded->code);
    Durairaj Avasi, Apr 8, 2004
    #1
    1. Advertising

  2. Durairaj Avasi

    Bob Walton Guest

    Durairaj Avasi wrote:

    ....
    > what i am doing wrong here... why this drives so grazy...

    ....


    > my $ldap = &lConnect('$myserver');


    -----------------------^---------^

    Well, one thing you are probably doing wrong is using ' to quote a
    string you evidently want interpolated. Interpolation does not occur in
    '-delimited strings, so you are attempting to connect to the server with
    the literal name: $myserver . That probably isn't the real name of your
    server. Remove the ' characters -- converting them to " would be a
    useless use of "'s, which can actually be worse than it sounds (see:

    perldoc -q quoting

    ).

    You should probably also check the result

    of your lConnect routine to see if it failed or not.

    If it did fail, you'd never know. And with that
    server name, it undoubtedly did fail. But I'm
    surprised you didn't notice the bad server name in
    the results of the print statement in lConnect.
    You *did* provide us with copy/pasted code, right,
    not a retyped version?


    ....

    --
    Bob Walton
    Email: http://bwalton.com/cgi-bin/emailbob.pl
    Bob Walton, Apr 9, 2004
    #2
    1. Advertising

  3. Bob Walton <> wrote in message news:<>...
    > Durairaj Avasi wrote:
    >
    > ...
    > > what i am doing wrong here... why this drives so grazy...

    > ...
    >
    >
    > > my $ldap = &lConnect('$myserver');

    >
    > -----------------------^---------^
    >
    > Well, one thing you are probably doing wrong is using ' to quote a
    > string you evidently want interpolated. Interpolation does not occur in
    > '-delimited strings, so you are attempting to connect to the server with
    > the literal name: $myserver . That probably isn't the real name of your
    > server. Remove the ' characters -- converting them to " would be a
    > useless use of "'s, which can actually be worse than it sounds (see:
    >
    > perldoc -q quoting
    >
    > ).
    >
    > You should probably also check the result
    >
    > of your lConnect routine to see if it failed or not.
    >
    > If it did fail, you'd never know. And with that
    > server name, it undoubtedly did fail. But I'm
    > surprised you didn't notice the bad server name in
    > the results of the print statement in lConnect.
    > You *did* provide us with copy/pasted code, right,
    > not a retyped version?
    >
    >
    > ...


    BOB

    use Net::LDAP qw(LDAP_SUCCESS LDAP_PROTOCOL_ERROR);
    use Authen::SASL;
    use Net::LDAP::Util qw(ldap_error_name ldap_error_text);

    sub lConnect {
    my $server = shift;
    print " the server name is $server\n";
    my $ldap = Net::LDAP->new($server, port=> 389, version => 3);
    print "=== The error is $@ <====\n";
    return($ldap);
    }

    my $ldap = &lConnect('111.11.11.1');
    my $sasl = Authen::SASL->new(mechanism => 'DIGEST-MD5', password
    =>'xyzabc');
    my $isBinded = $ldap->bind ('cn=durairaj
    avasi,ou=itdev,dc=cow,dc=net', sasl => $sasl, version => 3);#
    print "ERROR detected: -> ", ldap_error_name($isBinded->code), " ",
    ldap_error_text($isBinded->code);

    the above program returns the following::

    ERROR detected: -> LDAP_INVALID_CREDENTIALS The wrong password was
    supplied or t
    he SASL credentials could not be processed

    if do a normal bind like

    $ldab->bind($mydn, password=>$password, version => 3);

    ( NOTE without SASL )

    i am getting the following error

    ERROR detected: -> LDAP_STRONG_AUTH_REQUIRED The server requires
    authentication
    be performed with a SASL mechanism


    Tested with windows 2000 and windows xp getting the same error msg.
    Durairaj Avasi, Apr 9, 2004
    #3
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Miguel Dias Moura
    Replies:
    1
    Views:
    406
  2. Jeremy Watts

    what am i doing wrong here?

    Jeremy Watts, Jun 4, 2005, in forum: Java
    Replies:
    12
    Views:
    567
    Jeremy Watts
    Jun 5, 2005
  3. Replies:
    9
    Views:
    22,783
  4. =?ISO-8859-1?Q?Gerhard_H=E4ring?=

    Re: What am I doing wrong here?

    =?ISO-8859-1?Q?Gerhard_H=E4ring?=, Jun 30, 2003, in forum: Python
    Replies:
    1
    Views:
    700
    Bengt Richter
    Jun 30, 2003
  5. =?ISO-8859-1?Q?Gerhard_H=E4ring?=

    Re: What am I doing wrong here?

    =?ISO-8859-1?Q?Gerhard_H=E4ring?=, Jun 30, 2003, in forum: Python
    Replies:
    0
    Views:
    606
    =?ISO-8859-1?Q?Gerhard_H=E4ring?=
    Jun 30, 2003
Loading...

Share This Page