ArrayList<Modification> mods = new ArrayList<Modification>();
mods.add(new Modification(ModificationType.ADD,
Attributes.create("ds-cfg-default-root-privilege-name",
"proxied-auth")));
ModifyOperation modifyOperation =
internalRootConn.processModify(DN.decode("cn=Root DNs,cn=config"),
mods);
assertEquals(modifyOperation.getResultCode(), ResultCode.SUCCESS);
// Get a new root connection and verify that it now has proxied auth.
unprivRootEntry = DirectoryServer.getEntry(unprivRootDN);
authInfo = new AuthenticationInfo(unprivRootEntry, true);
unprivRootConn = new JmxClientConnection(jmxCtx,authInfo);
assertTrue(unprivRootConn.hasPrivilege(Privilege.PROXIED_AUTH, null));
// Update the set of root privileges to revoke proxied auth.
mods.clear();
mods.add(new Modification(ModificationType.DELETE,
Attributes.create("ds-cfg-default-root-privilege-name",
"proxied-auth")));
modifyOperation =
internalRootConn.processModify(DN.decode("cn=Root DNs,cn=config"),
mods);
assertEquals(modifyOperation.getResultCode(), ResultCode.SUCCESS);
// Get a new root connection and verify that it no longer has proxied auth.
unprivRootEntry = DirectoryServer.getEntry(unprivRootDN);
authInfo = new AuthenticationInfo(unprivRootEntry, true);