<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<style type="text/css" style="display:none"><!--P{margin-top:0;margin-bottom:0;} --></style>
</head>
<body dir="ltr" style="font-size:12pt;color:#000000;background-color:#FFFFFF;font-family:Calibri,Arial,Helvetica,sans-serif;">
<p>Hi,</p>
<p><br>
</p>
<p>Sorry in advance for the amount of inline xml below.<br>
</p>
<p><br>
</p>
<p>I am trying to create a setup, where midPoint roles create ldap groups in a tree of ou's. I am able to create the hierarchy and groups, but I am unable to actually make users be members of those groups.<br>
<br>
Studying the unix-ldap story leads me to think that group name calculation should best be performed in the resource configuration xml file so that it is easily usable in the membership inducement. Currently I do the name calculation in a role as follows:<br>
<br>
<br>
<inducement><br>
<construction><br>
<resourceRef oid="..." type="c:ResourceType"/><br>
<kind>entitlement</kind><br>
<intent>OrgServiceRoleLdapGroup</intent><br>
<attribute><br>
<ref>ri:dn</ref><br>
<matchingRule>mr:stringIgnoreCase</matchingRule><br>
<outbound><br>
<source><br>
<path>$assignment/orgRef</path><br>
</source><br>
<source><br>
<path>$immediateRole/name</path><br>
</source><br>
<expression><br>
<script><br>
<code><br>
import com.evolveum.midpoint.xml.ns._public.common.common_3.OrgType;<br>
import javax.naming.ldap.Rdn;<br>
import javax.naming.ldap.LdapName;<br>
<br>
org = midpoint.getObject(OrgType.class, orgRef.getOid());<br>
dn = new LdapName('ou=Roles,dc=kapa,dc=local');<br>
dn.add(new Rdn('ou', org.getName().getOrig()));<br>
dn.add(new Rdn('ou', name.toString().split(' ')[0]));<br>
dn.add(new Rdn('cn', 'viewer'));<br>
return dn.toString();<br>
</code><br>
</script><br>
</expression><br>
</outbound><br>
</attribute><br>
</construction><br>
</inducement></p>
<p><br>
</p>
<p>The corresponding (kind,intent) pair in the resource configuration is<br>
<br>
<objectType><br>
<kind>entitlement</kind><br>
<intent>OrgServiceRoleLdapGroup</intent><br>
<displayName>LDAP Group</displayName><br>
<objectClass>ri:groupOfNames</objectClass><br>
<br>
<attribute><br>
<ref>ri:member</ref><br>
<matchingRule>mr:distinguishedName</matchingRule><br>
<fetchStrategy>minimal</fetchStrategy><br>
<outbound><br>
<strength>strong</strength><br>
<!-- Workaround - groupOfNames MUST have at least one member. Even non-existent DN. --><br>
<expression><br>
<value>cn=dummy,o=whatever</value><br>
</expression><br>
</outbound><br>
</attribute> <br>
<attribute><br>
<ref>ri:description</ref><br>
<outbound><br>
<source><br>
<path>description</path><br>
</source><br>
</outbound><br>
</attribute><br>
<configuredCapabilities><br>
<cap:pagedSearch><br>
<cap:defaultSortField>ri:uid</cap:defaultSortField><br>
</cap:pagedSearch><br>
</configuredCapabilities><br>
<dependency><br>
<kind>generic</kind><br>
<intent>serviceOu</intent><br>
<strictness>relaxed</strictness><br>
</dependency><br>
</objectType><br>
<br>
If I naively cut the ri:dn attribute from the inducement in the role and paste it as an attribute in the above objectType, I get an error message complaining:<br>
<br>
"No variable with name assignment in source definition in mapping in outbound mapping for {.../resource/instance-3}dn in resource:46515c38-7fd3-41ec-bbef-42756fa19845(LDAP)"<br>
<br>
My question is, can I somehow access the assignment from an outbound mapping in the resource configuration? Or do I maybe need some kind of mediating mapping in the role?</p>
<p><br>
</p>
<p>Thanks, Pertti</p>
<p><br>
</p>
<p><br>
</p>
</body>
</html>