--On Thursday, November 09, 2006 7:59 PM -0400 Hans Poo <[EMAIL PROTECTED]> wrote:

Hi, thank your response:

I prepare the password:

my $digest = md5_base64("foo");

my $result = $ldap->modify(dn=>$dn,
replace=>{'userPassword'=>"{MD5}$digest"});

The expected result is to have {MD5}rL0Y20zC+Fzt72VPzMSk2A as the value
for  the userPassword field, but instead i get:

userPassword:: e01ENX1yTDBZMjB6QytGenQ3MlZQek1TazJB

If i base64 decode this password:

perl -MMIME::Base64 -e 'print decode_base64
("e01ENX1yTDBZMjB6QytGenQ3MlZQek1TazJB"), "\n"; '

I get {MD5}rL0Y20zC+Fzt72VPzMSk2A. For instance the password is encoded
twice to base64.

Sorry if i'am not seeing something obvious ?, i've been the whole day
looking in google.

Why are you base64 encoding the value yourself? There is no need for you to do that. It'll happen automatically when added to the LDAP server.

Basically, you are base64 encoding the word "foo", then then sticking {MD5} in front of that. Then the LDAP server is base 64 encoding that string value.

Just remove the

my $digest = md5_base64("foo");

line.

Chance replace to be:

replace=>{'userPassword'=>"{MD5}foo"});


--Quanah

--
Quanah Gibson-Mount
Principal Software Developer
ITS/Shared Application Services
Stanford University
GnuPG Public Key: http://www.stanford.edu/~quanah/pgp.html

Reply via email to