title: Modify uid in ldap repository
body: <p>I'm developping an application spring-boot for get user information on Ldap repository using LdapTemplate. </p>
  
  <p>I use user email as uid, when a user update his email I have to update his uid too. The problem is that the methods below work for all Person fields but not for UID. I get an error:</p>
  
  <pre><code>LDAP: error code 64 - value of naming attribute 'uid' is not present in entry
  </code></pre>
  
  <p>This is a snippet: </p>
  
  <pre><code>public void updateUser(Person p) throws InvalidNameException {
      Name dn = buildDn(p);
      DirContextOperations context = ldapTemplate.lookupContext(dn);
      LdapMapper.mapToContext(p, context);
      ldapTemplate.modifyAttributes(context);
  }
  </code></pre>
  
  <p>BuildDn:</p>
  
  <pre><code>public Name buildDn(Person p) throws InvalidNameException {
      List&lt;Rdn&gt; lstRdn = new ArrayList&lt;Rdn&gt;();
      lstRdn.add(new Rdn("dc", "priv"));
      lstRdn.add(new Rdn("dc", "com"));
      lstRdn.add(new Rdn("ou", "customers"));
      lstRdn.add(new Rdn("ou", "myusers");
      lstRdn.add(new Rdn("uid", "oldUid"));
  
      Name name = new LdapName(lstRdn);
  
      return name;
  }
  </code></pre>
  
  <p>Mapper</p>
  
  <pre><code>public static void mapToContext(Person p, DirContextOperations context) {
      context.setAttributeValues("objectclass", new String[] { "top", "person", "inetOrgPerson", "organizationalPerson" });
      context.setAttributeValue("cn", p.getFirstName());
      context.setAttributeValue("sn", p.getLastName());
      context.setAttributeValue("mail", p.getEmail());
      context.setAttributeValue("userPassword", p.getPassword());
      context.setAttributeValue("uid", "NewUid");
  }
  </code></pre>
  
  <p>Would you have any ideas to fix this bug ?</p>
  
  <p>Best regards</p>