Note that there are some explanatory texts on larger screens.

plurals
  1. POLDAP changing user password on Active Directory
    primarykey
    data
    text
    <p>I state that I am a complete beginner to LDAP.<br> I have to let a user change its own password through an Android device. User has NOT administrative privileges.<br> Using the <a href="http://www.unboundid.com/products/ldap-sdk" rel="nofollow">UnboudId LDAP SDK</a> for Java I'm able to bind to server and get the user entry using this code: </p> <pre><code>final SocketFactory _socket_factory; final SSLUtil _ssl_util = new SSLUtil(new TrustAllTrustManager()); try { _socket_factory = _ssl_util.createSSLSocketFactory(); } catch (Exception e) { Log.e(LOG_TAG, "*** Unable to initialize ssl", e); } LDAPConnectionOptions _ldap_connection_options = new LDAPConnectionOptions(); _ldap_connection_options.setAutoReconnect(true); _ldap_connection_options.setConnectTimeoutMillis(30000); _ldap_connection_options.setFollowReferrals(false); _ldap_connection_options.setMaxMessageSize(1024*1024); LDAPConnection _ldap_connection = new LDAPConnection(_socket_factory, _ldap_connection_options, [host ip], 636, [username], [password]); Filter _filter = Filter.create("(userPrincipalName=" + [username] + ")"); SearchRequest _search_request = new SearchRequest([base DN], SearchScope.SUB, _filter); _search_request.setSizeLimit(1000); _search_request.setTimeLimitSeconds(30); SearchResult _search_result = _connection.search(_search_request); </code></pre> <p>This works and I get 1 entry and all the relative attributes. Now my task is to change the password [password] with a new [new password].<br> My attempts: </p> <pre><code>PasswordModifyExtendedRequest _password_modify_request = new PasswordModifyExtendedRequest([found entry DN], [password], [new password]); PasswordModifyExtendedResult _password_modify_result = (PasswordModifyExtendedResult)_ldap_connection.processExtendedOperation(_password_modify_request); </code></pre> <p>This doesn't work due to LDAPException </p> <pre><code>LDAPException(resultCode=2 (protocol error), errorMessage='0000203D: LdapErr: DSID-0C090C7D, comment: Unknown extended request OID, data 0, vece��', diagnosticMessage='0000203D: LdapErr: DSID-0C090C7D, comment: Unknown extended request OID, data 0, vece��') </code></pre> <p>Then I've tryed </p> <pre><code>final Modification _replace_modification = new Modification(ModificationType.REPLACE, "unicodePwd", _get_quoted_string_bytes([new password])); LDAPResult _result = _connection.modify([found entry DN], _replace_modification); </code></pre> <p>This doesn't work due to LDAPException </p> <pre><code>LDAPException(resultCode=50 (insufficient access rights), errorMessage='00000005: SecErr: DSID-031A0F44, problem 4003 (INSUFF_ACCESS_RIGHTS), data 0) </code></pre> <p>Finally I've tryed</p> <pre><code>final Modification _delete_old_modification = new Modification(ModificationType.DELETE, "unicodePwd", _get_quoted_string_bytes([password])); final Modification _add_new_modification = new Modification(ModificationType.ADD, "unicodePwd", _get_quoted_string_bytes([new password])); final ArrayList&lt;Modification&gt; _modifications = new ArrayList&lt;Modification&gt;(); _modifications.add(_delete_old_modification); _modifications.add(_add_new_modification); LDAPResult _result = _connection.modify([found entry DN], _modifications); </code></pre> <p>This doesn't work due to LDAPException </p> <pre><code>LDAPException(resultCode=19 (constraint violation), errorMessage='00000005: AtrErr: DSID-03190F00, #1:0: 00000005: DSID-03190F00, problem 1005 (CONSTRAINT_ATT_TYPE), data 0, Att 9005a (unicodePwd)��', diagnosticMessage='00000005: AtrErr: DSID-03190F00, #1: 0: 00000005: DSID-03190F00, problem 1005 (CONSTRAINT_ATT_TYPE), data 0, Att 9005a (unicodePwd) ��') </code></pre> <p>And now i have no more ideas... Any help will be appreciated, thanks in advance</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload