john pfeiffer
  • Home
  • Categories
  • Tags
  • Archives

Ldap apacheds custom schema ldif

Apache Directory Studio (2.0 has x64 support!)

(If you naively start with just adding a User and then adding a Custom Attribute/Value you get the error LDAP: error code 65 OBJECT_CLASS VIOLATION, apparently "persons" cannot have hosts...)

To leverage the existing default schema/example from ApacheDS...

Connect to it with Apache Directory Studio -> DIT-> Root DSE -> schema

Right click on cn=inetorgperson -> Export -> LDIF Export (next to choose filename to save to)

Find and replace inetorgperson with inetorgpersonhost

NOTICED that sch \newline ema was in the exported .ldif so had to correct that!


Scroll down and find the object definition with m-name: inetorgpersonhost

Update it to not conflict with the existing inetOrgPerson schema (unique oid)

dn: m-oid=1.3.6.1.4.1.18060.0.1, ou=objectClasses, cn=inetorgpersonhost,ou=schema
m-oid: 1.3.6.1.4.1.18060.0.1

1.3.6.1.4.1.18060.0 has been assigned to the Apache Directory project by the ASF http://www.alvestrand.no/objectid/top.html (we've chosen from the Private Enterprise OID range)

Update it to use the cosine.ldif "host" attribute

m-may: homePostalAddress
m-may: host
m-may: initials

Remove all of the definitions at the end after the m-name= inetorgpersonhost object entry as we do not want to redefine those objects, just to create a new composite object with the existing host attribute


Right click on DIT-> Root DSE -> schema "import" and choose your new inetorgpersonhost.ldif

(maybe only needs schema refresh and then disconnect and reconnect but what worked...)

ON the LDAP server with ApacheDS installed: /etc/init.d/apacheds-1.5.7-default restart

Connect again and right click on ou=system -> ou=users -> New Entry (from scratch) NOW inetorgpersonhost is now available in "Available object classes"

After defining the RDS (uid=johnsmith) and filling in the cn / sn required inetOrgPerson fields Double click on the new User Account (uid=johnsmith) -> right click in the profile (or look for the +) New Attribute (attribute type = host) , Finish Then fill in the value (i.e. my.example.com )



UNUSED NOTES:

File -> New -> (Wizards) Schema Editor -> New Schema Project -> OpenLDAP -> core schemas (select all)

Then for some reason core->residentialPerson, nis -> ipProtocol, and another Object Class have errors (delete them?)

File -> Open File -> sevenSeas.schema

Now you can click on Export -> LDAP to LDIF

Create some object with an attribute according to RFC 4512

Doing so to inetorgperson, cosine and reviewing the .ldif text files can be very instructive

When creating a New Entry you can actually pick multiple templates and join them! (i.e. account + inetOrgPerson) , for simplicity ensure that RDN is only uid BUT NOW you have a "host" entry for a "user"

http://www.openldap.org/doc/admin23/schema.html


FOR COMPLETENESS:

version: 1

dn: cn=inetorgpersonhost,ou=schema objectClass: metaSchema objectClass: top cn: inetorgpersonhost m-dependencies: system m-dependencies: core m-dependencies: cosine

dn: ou=attributeTypes,cn=inetorgpersonhost,ou=schema objectClass: organizationalUnit objectClass: top ou: attributetypes

dn: ou=ditStructureRules,cn=inetorgpersonhost,ou=schema objectClass: organizationalUnit objectClass: top ou: ditstructurerules

dn: ou=syntaxes,cn=inetorgpersonhost,ou=schema objectClass: organizationalUnit objectClass: top ou: syntaxes

dn: ou=comparators,cn=inetorgpersonhost,ou=schema objectClass: organizationalUnit objectClass: top ou: comparators

dn: ou=ditContentRules,cn=inetorgpersonhost,ou=schema objectClass: organizationalUnit objectClass: top ou: ditcontentrules

dn: ou=matchingRules,cn=inetorgpersonhost,ou=schema objectClass: organizationalUnit objectClass: top ou: matchingrules

dn: ou=objectClasses,cn=inetorgpersonhost,ou=schema objectClass: organizationalUnit objectClass: top ou: objectclasses

dn: ou=normalizers,cn=inetorgpersonhost,ou=schema objectClass: organizationalUnit objectClass: top ou: normalizers

dn: ou=nameForms,cn=inetorgpersonhost,ou=schema objectClass: organizationalUnit objectClass: top ou: nameforms

dn: ou=matchingRuleUse,cn=inetorgpersonhost,ou=schema objectClass: organizationalUnit objectClass: top ou: matchingruleuse

dn: ou=syntaxCheckers,cn=inetorgpersonhost,ou=schema objectClass: organizationalUnit objectClass: top ou: syntaxcheckers

dn: m-oid=1.3.6.1.4.1.18060.0.1, ou=objectClasses, cn=inetorgpersonhost,ou=schema objectClass: metaObjectClass objectClass: metaTop objectClass: top m-oid: 1.3.6.1.4.1.18060.0.1 m-description: RFC2798: Internet Organizational Person m-may: audio m-may: businessCategory m-may: carLicense m-may: departmentNumber m-may: displayName m-may: employeeNumber m-may: employeeType m-may: givenName m-may: homePhone m-may: homePostalAddress m-may: host m-may: initials m-may: jpegPhoto m-may: labeledURI m-may: mail m-may: manager m-may: mobile m-may: o m-may: pager m-may: photo m-may: roomNumber m-may: secretary m-may: uid m-may: userCertificate m-may: x500UniqueIdentifier m-may: preferredLanguage m-may: userSMIMECertificate m-may: userPKCS12 m-name: inetorgpersonhost m-supobjectclass: organizationalPerson


  • « Mysql table join cut sed convert to java properties file
  • tomcat java servlets manual install windows linux »

Published

Aug 27, 2012

Category

linux

~593 words

Tags

  • apacheds 2
  • custom 14
  • ldap 8
  • ldif 1
  • linux 249
  • schema 1