How do I resolve “WILL_NOT_PERFORM” MS AD reply when trying to change password in scala w/ the unboundid LDAP SDK?

后端 未结 3 2052
庸人自扰
庸人自扰 2020-12-01 19:44

I\'m wrestling with Active Directory, trying to get it to let me change a password. I\'ve found tons of useful information, but I\'m still getting a persistent error.

3条回答
  •  無奈伤痛
    2020-12-01 20:44

    My guess is "unicodePwd: " + '"' + newPass + '"' is circumventing your encoding (as String has to be converted to bytes again and I bet it's not using the right encoding).

    Try using the version of MofifyRequest that takes Modification objects and then use the constructor that takes the attributes value as bytes.

    val newPass = "\"Jfi8ZH8#k\"".getBytes("UTF-16LE")
    // note the dquotes inside the string
    
    val mod = new Modification(ModificationType.REPLACE, "unicodePwd", newPass)
    

    just like in the blog post you linked to...

提交回复
热议问题