title: Spring LdapTemplate - attribute 'gidNumber' not allowed exception
body: <p>I'm trying to control OpenLDAP using Spring LDAPTemplate. </p>
  
  <p>In LDAP, I've groups and users organization units. I'm trying to bind new users into LDAP with group association. (<em>Generic User Account</em>) So when I try to bind a new user, I also put <code>gidNumber</code> attiribute into attributes object. But I'm getting an error like this: </p>
  
  <pre><code>[LDAP: error code 65 - attribute 'gidNumber' not allowed]; nested exception is javax.naming.directory.SchemaViolationException: [LDAP: error code 65 - attribute 'gidNumber' not allowed]; remaining name 'ou=staff'
  </code></pre>
  
  <p>Here's what I've tried so far:</p>
  
  <pre><code>DistinguishedName dn = new DistinguishedName();
  dn.add("ou", "staff");
  Attributes attributes = new BasicAttributes();
  attributes.put("objectClass", "inetOrgPerson");
  attributes.put("uid", username);
  attributes.put("givenName", name);
  attributes.put("gidNumber", gidNumber.toString());
  attributes.put("sn", surname);
  attributes.put("cn", name + " " + surname);
  attributes.put("userPassword", password);
  ldapTemplate.bind(dn, null, attributes);
  </code></pre>
  
  <p>Here's my schema:</p>
  
  <pre><code>+--&gt; dc=ibu,dc=edu,dc=tr (5)
    ---&gt; cn=admin
    +--&gt; ou=group (1)
      | ---&gt; cn=Academic
    ---&gt; ou=guest
    +--&gt; ou=staff (2)
      | ---&gt; cn=John Clark
    ---&gt; ou=student
  </code></pre>