eLDAP member offline |
|
posts: |
107 |
joined: |
08/02/2006 |
from: |
Austin, TX |
|
|
|
|
|
What's extensibleObject used for? |
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.
|
|
|
|
|
|