Question

I am using ApacheDS Server as an LDAP Server. I have created a custom attribute to use in my LDAP structure that I have defined. I have created a schema and inside the Schema I have defined an ObjectClass and an attribute called dateOfBirth. I exported the Schema and imported it into the DIT of ApacheDS. The schema is imported and can view the dateOfBirth attribute.

However, when I try to add it I get a warning saying:

Warning according to the schema attribute dateOfBirth is not allowed.

Do you still want to add the new value?

The dateOfBirth is to store information about a Person. The Person object class in LDAP is called inetOrgPerson ObjectClass. What is the best way to add the dateOfBirth in order to use it?

Was it helpful?

Solution 2

There is no need to define a dateOfBirth attribute. The auxiliary objectClass naturalPerson - described in RFC2985 - already allows this attribute using generalizedTimeSyntax. Add the naturalPerson objectClass to your entry, then add a dateOfBirth attribute that conforms to generalizedTimeSyntax.

dn: cn=myPerson,dc=example,dc=com
objectClass: top
objectClass: inetOrgPerson
objectClass: naturalPerson
dateOfBirth: 20121115121912.810Z

and so forth.

Update: example objectClass definition from RC2985.

dn: cn=schema
objectClass: top
objectClass: ldapSubentry
objectClass: subSchema
objectClasses: ( 1.2.840.113549.1.9.24.2 NAME 'naturalPerson'
  SUP top
  AUXILIARY
  MAY ( emailAddress $
    unstructuredName $
    unstructuredAddress $
    dateOfBirth $
    placeOfBirth $
    gender $
    countryOfCitizenship $
    countryOfResidence $
    pseudonym $
    serialNumber )
  X-ORIGIN 'RFC 2985' ) 

OTHER TIPS

You can add custom object and attributes(should not exist) in Apache DS using Apache directory studio.

The Steps are

  1. Open the Apache Directory Studio.
  2. Go to the Schema Editor perspective.
  3. Right click in project pane and create new schema project.
  4. Choose offline/online and give project name.
  5. Open the connection
  6. Right click on schema pane and create new schema with unique name(ex. test123).
  7. Under the schema can create new attributes and object for those attributes.(look at existing objects for reference)
  8. Once done everything, can export as .ldif file (let say test.ldif)
  9. Now go to the LDAP Browser perspective.
  10. Right on ou=schema object and click on import as LDIF.
  11. import the LDIF file which is exported from schema project(step-8).
  12. Successfully done and refresh the ou=schema object you can see the added object.
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top