go to  ForumEasy.com   
LdapPro
Home » Archive » Message


[Email To Friend][View in Live Context][prev topic « prev post | next post » next topic]
  What's extensibleObject used for?
 
Subject: What's extensibleObject used for?
Author: eLDAP
Posted on: 01/30/2007 08:46:52 PM

extensibleObject is objectclass defined in RFC 2252 to allow for flexibility of adding and modifying attributes on the server side.

objectClasses: ( 1.3.6.1.4.1.1466.101.120.111 NAME 'extensibleObject' DESC 'LDAPv3 extensible object' SUP top AUXILIARY X-ORIGIN 'RFC 2252' )


For example, the following code

	  DirContext ctx = new InitialDirContext(env);
		
	  // Create attributes to be associated with object
	  Attributes attrs = new BasicAttributes(true); // case-ignore
	  Attribute objclass = new BasicAttribute("objectclass");
	  objclass.add("top");
	  objclass.add("person");
	  attrs.put(objclass);
	  attrs("sn", "Smith");
	  attrs("givenName", "John");
	  attrs("cn", "John Smith");
	  attrs("ssn", "999-99-9999");
	
	  // Perform bind
	  ctx.bind("cn=John Smith,ou=People,dc=myCompany,dc=Com", attrs);


is going to throw exception of 'InvalidAttributeIdentifierException', since attribute 'ssn' is not defined in MUST or MAY list of 'person'. For 'ssn' to be added into DIT, the 'extensibleObject' objectclass should be added to make any (extra) attributes valid.

	  DirContext ctx = new InitialDirContext(env);
		
	  // Create attributes to be associated with object
	  Attributes attrs = new BasicAttributes(true); // case-ignore
	  Attribute objclass = new BasicAttribute("objectclass");
	  objclass.add("top");
	  objclass.add("person");
	  objclass.add("extensibleObject");
	  attrs.put(objclass);
	  attrs("sn", "Smith");
	  attrs("givenName", "John");
	  attrs("cn", "John Smith");
	  attrs("ssn", "999-99-9999");
	
	  // Perform bind
	  ctx.bind("cn=John Smith,ou=People,dc=myCompany,dc=Com", attrs);


Definitely, your server must support the extensibleObject objectclass anyway.




References:

 


 
Powered by ForumEasy © 2002-2022, All Rights Reserved. | Privacy Policy | Terms of Use
 
Get your own forum today. It's easy and free.