permaculture playing cards*
The moose likes Security and the fly likes how to add a new attribute to Apache DS Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Engineering » Security
Bookmark "how to add a new attribute to Apache DS" Watch "how to add a new attribute to Apache DS" New topic
Author

how to add a new attribute to Apache DS

ganesh boil
Greenhorn

Joined: Sep 17, 2009
Posts: 14
Hi Team,
I'm using Apache DS 1.5.5 version.
As part of my new requirement I want to add a new attribute called "groupMembership" to the "inetOrgPerson" schema.
But i did not find any .schema files in the installation.
So can anyone suggest me the answers for the following questions.

1.How to add a new attribute to the existed schema file for ex: inetOrgPerson

2.where to place a new schema file and object class file.

3.And 3rd one is, I want to add a new domain like, o=xxx, dc=test, dc=com. In which file i need to add these new domain.

Thanks in advance.

Regards,
Ganesh
Drazen Grabovac
Greenhorn

Joined: Apr 22, 2009
Posts: 8
Hi,
1. If you want to change the scheme to add new attributes or classes you need to add records under ou=schema. Just add a new record under ou=attributeTypes and then you can use the new attribute.
2. You can add records by using Apache Directory Studio (or any other LDAP client) and selecting new entry, or by importing files. You don't add entries to schema by placing some file somewhere.
3. If you want to add a new domain you need to make a new partition in the %APACHEDS%/conf/server.xml and then make a new Context entry in the apache directory studio.

Hope this helps,
Drazen
ganesh boil
Greenhorn

Joined: Sep 17, 2009
Posts: 14
Hi Drazen,
Thanks for your reply. I didnot understand your 1st point.
I mean in which file do i need to add ou=xxx.
my scenario is just i want to add an attribute named "groupMembership" to "inetOrgPerson" schema.
I'm using ldap admin as ldap client.
do i need to add it through client or in any other configuration file which is available in Apache DS installation ?
Drazen Grabovac
Greenhorn

Joined: Apr 22, 2009
Posts: 8
Hi,
Schema is not a separate file it is just metadata, so you add attributes and objectClasses to it like any other data with a client.
Here is an example of how we add our custom attributes to the schema:

dn: m-oid=1.3.6.1.4.1.27132.1.1.4, ou=attributeTypes, cn=bbb, ou=schema
objectClass: metaAttributeType
objectClass: metaTop
objectClass: top
m-description: DN principala
m-name: principalDN
m-oid: 1.3.6.1.4.1.27132.1.1.4
m-supAttributeType: uniqueMember

We have this in a ldif file that we import with the apache directory studio. This adds the record to the schema and makes the attribute visible.
Regs,
Drazen
 
jQuery in Action, 2nd edition
 
subject: how to add a new attribute to Apache DS
 
Similar Threads
javax.naming.directory.SchemaViolationException on LDAP
LDAP: Recommended way to add new objectclass to existing entries?
Apache DS : LDIF import not working
How to Import a file
How to Modify multivalued attribute in LDAP using java API?