You are viewing a plain text version of this content. The canonical link for it is here.
Posted to api@directory.apache.org by "Myrtil, Benson" <bm...@charterschoolsusa.com> on 2015/06/17 18:57:15 UTC

Updating unicodePwd

Does any one have any working code of updating the unicodePwd.

connectionConfig.setLdapHost( server );
connectionConfig.setLdapPort( 636 );
connectionConfig.setName( username );
connectionConfig.setCredentials( password );
connectionConfig.setUseSsl( 1 );
connectionConfig.setSslProtocol( "SSLv3" );

I can bind just fine and create an account but when i try to update the password I get the follow error:

Messages: 0000001F: SvcErr: DSID-031A12D2, problem 5003 (WILL_NOT_PERFORM), data 0

Im pretty sure the password encoding is correct because i took an example straight from the Tech Microsoft site. Any ideas?

Re: Updating unicodePwd

Posted by Emmanuel Lécharny <el...@gmail.com>.
Le 19/06/15 14:23, Myrtil, Benson a écrit :
> I got this working but ended up having to use javax.naming.directory.InitialDirContext

What would help here is that you create a JIRA with your code with the
API and JNDI. We may have a bug somewhere in the API, but it's hard to
see where without going through some code that is not proven to work,
and without having a wireshark capture in both cases.


Re: Updating unicodePwd

Posted by "Myrtil, Benson" <bm...@charterschoolsusa.com>.
I got this working but ended up having to use javax.naming.directory.InitialDirContext

On Jun 17, 2015, at 6:14 PM, Emmanuel Lécharny <el...@gmail.com>> wrote:

Le 17/06/15 19:57, Myrtil, Benson a écrit :
Very nice article. I been googling for 3 days now and didn’t find that one. However, I am still getting the same issue. Below is how I am handling the password.

password = “FakePasswordTest”;
quotedPassword = '"' & password & '"';
bytePassword = quotedPassword.getBytes("UTF-16LE");
toBase64 = toBase64(bytePassword);

The joy of playing with AD :/

have you checked that :
http://stackoverflow.com/questions/6797955/how-do-i-resolve-will-not-perform-ms-ad-reply-when-trying-to-change-password-i


Good luck !



Re: Updating unicodePwd

Posted by Emmanuel Lécharny <el...@gmail.com>.
Le 17/06/15 19:57, Myrtil, Benson a écrit :
> Very nice article. I been googling for 3 days now and didn’t find that one. However, I am still getting the same issue. Below is how I am handling the password.
>
> password = “FakePasswordTest”;
> quotedPassword = '"' & password & '"';
> bytePassword = quotedPassword.getBytes("UTF-16LE");
> toBase64 = toBase64(bytePassword);

The joy of playing with AD :/

have you checked that :
http://stackoverflow.com/questions/6797955/how-do-i-resolve-will-not-perform-ms-ad-reply-when-trying-to-change-password-i


Good luck !


Re: Updating unicodePwd

Posted by "Myrtil, Benson" <bm...@charterschoolsusa.com>.
Very nice article. I been googling for 3 days now and didn’t find that one. However, I am still getting the same issue. Below is how I am handling the password.

password = “FakePasswordTest”;
quotedPassword = '"' & password & '"';
bytePassword = quotedPassword.getBytes("UTF-16LE");
toBase64 = toBase64(bytePassword);

I verified the complexity on the AD server only requires a minimum of 8 characters. No other constraints exist. I read that the password had to be changed to base64 after getting the bytes so I tried that way as well. Neither works.

On Jun 17, 2015, at 1:44 PM, Richard Sand <rs...@idfconnect.com>> wrote:

There is something else you are missing that AD requires in addition to the SSL - it is very finicky about setting the password, and I've seen many times where create-user succeeds but setting the password fails.

Are you properly encoding the password attribute? UTF-16 and quoted?

Here's a good article to reference I just googled:

http://www.dirmgr.com/blog/2010/8/26/ldap-password-changes-in-active-directory.html

Hope this helps...

R-Richard

[cid:part1.04010300.09020507@idfconnect.com]
Myrtil, Benson<ma...@charterschoolsusa.com>
June 17, 2015 at 12:57 PM
Does any one have any working code of updating the unicodePwd.

connectionConfig.setLdapHost( server );
connectionConfig.setLdapPort( 636 );
connectionConfig.setName( username );
connectionConfig.setCredentials( password );
connectionConfig.setUseSsl( 1 );
connectionConfig.setSslProtocol( "SSLv3" );

I can bind just fine and create an account but when i try to update the password I get the follow error:

Messages: 0000001F: SvcErr: DSID-031A12D2, problem 5003 (WILL_NOT_PERFORM), data 0

Im pretty sure the password encoding is correct because i took an example straight from the Tech Microsoft site. Any ideas?



Re: Updating unicodePwd

Posted by Richard Sand <rs...@idfconnect.com>.
There is something else you are missing that AD requires in addition to 
the SSL - it is very finicky about setting the password, and I've seen 
many times where create-user succeeds but setting the password fails.

Are you properly encoding the password attribute? UTF-16 and quoted?

Here's a good article to reference I just googled:

http://www.dirmgr.com/blog/2010/8/26/ldap-password-changes-in-active-directory.html

Hope this helps...

R-Richard

> Myrtil, Benson <ma...@charterschoolsusa.com>
> June 17, 2015 at 12:57 PM
> Does any one have any working code of updating the unicodePwd.
>
> connectionConfig.setLdapHost( server );
> connectionConfig.setLdapPort( 636 );
> connectionConfig.setName( username );
> connectionConfig.setCredentials( password );
> connectionConfig.setUseSsl( 1 );
> connectionConfig.setSslProtocol( "SSLv3" );
>
> I can bind just fine and create an account but when i try to update 
> the password I get the follow error:
>
> Messages: 0000001F: SvcErr: DSID-031A12D2, problem 5003 
> (WILL_NOT_PERFORM), data 0
>
> Im pretty sure the password encoding is correct because i took an 
> example straight from the Tech Microsoft site. Any ideas?
>