Originally Posted by sharvancik
Off the Applications container we have stored our Actions and our Application Roles. We are building a new application to allow us to programatically add the role privileges into the LDAP.
I am able to add my actions (an ou entry), but not the final leaf off my actions (a cn entry).
My java code for adding the action (node prior to the role) is:
// This works fine
String newfpRoleDn = preFix + "=" + fpRole + "," + fpRoleDn;
ctx = ldapSearcher.getDirContext();
BasicAttributes attrs = null;
Attribute attr = null;
attrs = new BasicAttributes();
attr = new BasicAttribute(preFix, fpRole);
attrs.put(attr);
attr = new BasicAttribute("objectClass", "organizationalUnit");
attrs.put(attr);
ctx.createSubcontext(newfpRoleDn, attrs);
ctx.close();
My java code for adding the role is something like this:
// this is not working
BasicAttributes myAttrs = new BasicAttributes(true);
Attribute oc = new BasicAttribute("objectclass");
oc.add("top");
oc.add("organizationalRole");
myAttrs.put(oc);
myAttrs.put("cn",newRoleDn);
// When I use bind I get the error:
// [LDAP: error code 17 - Undefined Attribute Type]; remaining name 'ou=ReportAdministrator_EVENSTEVENOLD,ou=DHFSDCFSdWAccess,ou=dWisacwis,ou=Applications,ou='
ctx.bind(roleDn, newRoleDn, myAttrs);
// When I use the createSubcontext I get the error:
// [LDAP: error code 19 - NDS error: syntax violation (-613)]; remaining name 'cn=DHFSDCFSdWReportAdministrator_VVVVEEEEEODS,ou=Re ...
ctx.createSubcontext(newRoleDn, myAttrs);
ctx.close();
I can add organizations, I can add individuals, I can add attributes to organizations or individuals. I can add actions, but I am not able to add an Application Role.
Can someone help me please? Every example I see is adding a person. Not all adds are people.
Thanks