<html><body><div style="font-family: times new roman, new york, times, serif; font-size: 12pt; color: #000000"><div>Hi Glenn,<br></div><div><br></div><div>the trick with object template from Roman and Gustav is one (probably best) possibility.<br></div><div><br></div><div>I can imagine also something like this (not tested, but should work):<br></div><div><br></div><div><attribute><br>  <ref>icfs:name</ref><br>  <inbound></div><div>    <source></div><div>      <path>$account/accountUsername</path><br></div><div>    </source></div><div><div>    <source></div><div>      <path>$account/accountFirstname</path></div>    </source></div><div><div>    <source></div><div>      <path>$account/accountLastname</path></div>    </source><br>    <expression><br>      <script><br>        <code></div><div>if (!basic.isEmpty(accountUsername)) {<br></div><div>  return accountUsername // return accountUsername if it's not null<br></div><div>} else {<br></div><div>  return accountFirstname + '.' + accountLastname // do whatever you need here<br></div><div>}<br></div><div>        </code><br>      </script><br>    </expression><br>    <target><br>      <path>$user/name</path><br>    </target><br>  </inbound><br></div><div></attribute><br></div><div><br></div><div>The mapping is inbound for icfs:name, because for normal connector, that attribute will always exist.<br></div><div>I don't know if you already have some inbound for that attribute, but you can have several (more than 1) inbounds for the same attribute.<br></div><div>The question is if the mapping should also change the existing username in midPoint, if not, the mapping should be weak.<br></div><div><br></div><div>Please note that this solution will <strong>not</strong> generate unique username in midPoint. For that you must use object template with iterators [1].<br></div><div><br></div><div>[1] https://wiki.evolveum.com/display/midPoint/Unique+midPoint+User+Name<br></div><div><br></div><div>Regards,<br></div><div>Ivan<br></div><div><br></div><hr id="zwchr"><blockquote style="border-left:2px solid #1010FF;margin-left:5px;padding-left:5px;color:#000;font-weight:normal;font-style:normal;text-decoration:none;font-family:Helvetica,Arial,sans-serif;font-size:12pt;"><b>From: </b>"BOSCHMANS Glenn" <gboschmans@cibg.brussels><br><b>To: </b>midpoint@lists.evolveum.com<br><b>Sent: </b>Monday, May 15, 2017 4:36:26 PM<br><b>Subject: </b>[midPoint] Generation of $user/name on reconcilitation of new        account<br><div><br></div>



<style><!--

@font-face
        {font-family:Wingdings;
        panose-1:5 0 0 0 0 0 0 0 0 0;}
@font-face
        {font-family:"Cambria Math";
        panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}

p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0cm;
        margin-bottom:.0001pt;
        font-size:11.0pt;
        font-family:"Calibri",sans-serif;
        mso-fareast-language:EN-US;}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:#0563C1;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {mso-style-priority:99;
        color:#954F72;
        text-decoration:underline;}
p.MsoListParagraph, li.MsoListParagraph, div.MsoListParagraph
        {mso-style-priority:34;
        margin-top:0cm;
        margin-right:0cm;
        margin-bottom:0cm;
        margin-left:36.0pt;
        margin-bottom:.0001pt;
        font-size:11.0pt;
        font-family:"Calibri",sans-serif;
        mso-fareast-language:EN-US;}
span.EmailStyle17
        {mso-style-type:personal-compose;
        font-family:"Arial",sans-serif;
        color:windowtext;}
.MsoChpDefault
        {mso-style-type:export-only;
        font-family:"Calibri",sans-serif;
        mso-fareast-language:EN-US;}
@page WordSection1
        {size:612.0pt 792.0pt;
        margin:72.0pt 72.0pt 72.0pt 72.0pt;}
div.WordSection1
        {page:WordSection1;}

@list l0
        {mso-list-id:524681697;
        mso-list-type:hybrid;
        mso-list-template-ids:1903963822 -955470818 135462915 135462917 135462913 135462915 135462917 135462913 135462915 135462917;}
@list l0:level1
        {mso-level-start-at:0;
        mso-level-number-format:bullet;
        mso-level-text:\F0F0;
        mso-level-tab-stop:none;
        mso-level-number-position:left;
        text-indent:-18.0pt;
        font-family:Wingdings;
        mso-fareast-font-family:Calibri;
        mso-bidi-font-family:"Times New Roman";}
@list l0:level2
        {mso-level-number-format:bullet;
        mso-level-text:o;
        mso-level-tab-stop:none;
        mso-level-number-position:left;
        text-indent:-18.0pt;
        font-family:"Courier New";}
@list l0:level3
        {mso-level-number-format:bullet;
        mso-level-text:\F0A7;
        mso-level-tab-stop:none;
        mso-level-number-position:left;
        text-indent:-18.0pt;
        font-family:Wingdings;}
@list l0:level4
        {mso-level-number-format:bullet;
        mso-level-text:\F0B7;
        mso-level-tab-stop:none;
        mso-level-number-position:left;
        text-indent:-18.0pt;
        font-family:Symbol;}
@list l0:level5
        {mso-level-number-format:bullet;
        mso-level-text:o;
        mso-level-tab-stop:none;
        mso-level-number-position:left;
        text-indent:-18.0pt;
        font-family:"Courier New";}
@list l0:level6
        {mso-level-number-format:bullet;
        mso-level-text:\F0A7;
        mso-level-tab-stop:none;
        mso-level-number-position:left;
        text-indent:-18.0pt;
        font-family:Wingdings;}
@list l0:level7
        {mso-level-number-format:bullet;
        mso-level-text:\F0B7;
        mso-level-tab-stop:none;
        mso-level-number-position:left;
        text-indent:-18.0pt;
        font-family:Symbol;}
@list l0:level8
        {mso-level-number-format:bullet;
        mso-level-text:o;
        mso-level-tab-stop:none;
        mso-level-number-position:left;
        text-indent:-18.0pt;
        font-family:"Courier New";}
@list l0:level9
        {mso-level-number-format:bullet;
        mso-level-text:\F0A7;
        mso-level-tab-stop:none;
        mso-level-number-position:left;
        text-indent:-18.0pt;
        font-family:Wingdings;}
@list l1
        {mso-list-id:1495755648;
        mso-list-type:hybrid;
        mso-list-template-ids:1443426092 767585224 135462915 135462917 135462913 135462915 135462917 135462913 135462915 135462917;}
@list l1:level1
        {mso-level-start-at:0;
        mso-level-number-format:bullet;
        mso-level-text:\F0F0;
        mso-level-tab-stop:none;
        mso-level-number-position:left;
        text-indent:-18.0pt;
        font-family:Wingdings;
        mso-fareast-font-family:Calibri;
        mso-bidi-font-family:"Times New Roman";}
@list l1:level2
        {mso-level-number-format:bullet;
        mso-level-text:o;
        mso-level-tab-stop:none;
        mso-level-number-position:left;
        text-indent:-18.0pt;
        font-family:"Courier New";}
@list l1:level3
        {mso-level-number-format:bullet;
        mso-level-text:\F0A7;
        mso-level-tab-stop:none;
        mso-level-number-position:left;
        text-indent:-18.0pt;
        font-family:Wingdings;}
@list l1:level4
        {mso-level-number-format:bullet;
        mso-level-text:\F0B7;
        mso-level-tab-stop:none;
        mso-level-number-position:left;
        text-indent:-18.0pt;
        font-family:Symbol;}
@list l1:level5
        {mso-level-number-format:bullet;
        mso-level-text:o;
        mso-level-tab-stop:none;
        mso-level-number-position:left;
        text-indent:-18.0pt;
        font-family:"Courier New";}
@list l1:level6
        {mso-level-number-format:bullet;
        mso-level-text:\F0A7;
        mso-level-tab-stop:none;
        mso-level-number-position:left;
        text-indent:-18.0pt;
        font-family:Wingdings;}
@list l1:level7
        {mso-level-number-format:bullet;
        mso-level-text:\F0B7;
        mso-level-tab-stop:none;
        mso-level-number-position:left;
        text-indent:-18.0pt;
        font-family:Symbol;}
@list l1:level8
        {mso-level-number-format:bullet;
        mso-level-text:o;
        mso-level-tab-stop:none;
        mso-level-number-position:left;
        text-indent:-18.0pt;
        font-family:"Courier New";}
@list l1:level9
        {mso-level-number-format:bullet;
        mso-level-text:\F0A7;
        mso-level-tab-stop:none;
        mso-level-number-position:left;
        text-indent:-18.0pt;
        font-family:Wingdings;}
ol
        {margin-bottom:0cm;}
ul
        {margin-bottom:0cm;}
--></style>


<div class="WordSection1">
<p class="MsoNormal"><span style="font-size:9.0pt;font-family:"Arial",sans-serif" lang="EN-US">Hi all,</span></p>
<p class="MsoNormal"><span style="font-size:9.0pt;font-family:"Arial",sans-serif" lang="EN-US"> </span></p>
<p class="MsoNormal"><span style="font-size:9.0pt;font-family:"Arial",sans-serif" lang="EN-US">We are creating a new environment in which midPoint will be used as IDM and WSO2 IS as IdP. When a user registers in the IdP (through Just In Time-provisioning with
 a federated IdP) this will be based on their eID. A username is not created, and thus not stored in the database userstore.
</span></p>
<p class="MsoNormal"><span style="font-size:9.0pt;font-family:"Arial",sans-serif" lang="EN-US">The next step is to add those users in midPoint. We planned on doing reconciliation during live synchronization. However, as the username is null in the database,
 we don’t have a value for the $user/name attribute and so the creation of the new user fails.</span></p>
<p class="MsoNormal"><span style="font-size:9.0pt;font-family:"Arial",sans-serif" lang="EN-US"> </span></p>
<p class="MsoNormal"><span style="font-size:9.0pt;font-family:"Arial",sans-serif" lang="EN-US">Is there a possibility in the schema handling to configure the first name and last name to generate a username? For example:</span></p>
<p class="MsoNormal"><span style="font-size:9.0pt;font-family:"Arial",sans-serif" lang="EN-US">accountFirstName: Glenn</span></p>
<p class="MsoNormal"><span style="font-size:9.0pt;font-family:"Arial",sans-serif" lang="EN-US">accountLastName: Boschmans</span></p>
<p class="MsoNormal"><span style="font-size:9.0pt;font-family:"Arial",sans-serif" lang="EN-US"> </span></p>
<p class="MsoNormal" style="margin-left:18.0pt"><span style="font-size:9.0pt;font-family:"Arial",sans-serif" lang="EN-US">-> $user/name: gboschmans</span></p>
<p class="MsoNormal"><span style="font-size:9.0pt;font-family:"Arial",sans-serif" lang="EN-US"> </span></p>
<p class="MsoNormal"><span style="font-size:9.0pt;font-family:"Arial",sans-serif" lang="EN-US">I thought about using a Groovy script in the inbound of accountUsername to see if the attribute accountUsername is null. If not null return the value of the accountUsername
 attribute. If it is null, then I want to generate the username based on attributes accountFirstName and accountLastName. However, I’m not sure if it is possible to get the values of attributes accountFirstName and accountLastName.
</span></p>
<p class="MsoNormal"><span style="font-size:9.0pt;font-family:"Arial",sans-serif" lang="EN-US"> </span></p>
<p class="MsoNormal"><span style="font-size:9.0pt;font-family:"Arial",sans-serif" lang="EN-US">Any ideas?
</span></p>
<p class="MsoNormal"><span style="font-size:9.0pt;font-family:"Arial",sans-serif" lang="EN-US"> </span></p>
<p class="MsoNormal"><span style="font-size:9.0pt;font-family:"Arial",sans-serif" lang="EN-US">Thanks in advance!</span></p>
<p class="MsoNormal"><span style="font-size:9.0pt;font-family:"Arial",sans-serif" lang="EN-US"> </span></p>
<p class="MsoNormal"><span style="font-size:9.0pt;font-family:"Arial",sans-serif" lang="EN-US">Best regards,</span></p>
<p class="MsoNormal"><span style="font-size:9.0pt;font-family:"Arial",sans-serif" lang="EN-US">Glenn Boschmans</span></p>
</div>
<div lang="FR-BE">
<div class="WordSection1">
<table class="mceItemTable" border="0">
<tbody>
<tr>
<td style="BORDER-RIGHT: #fecb00 thin solid; WIDTH: 306px" width="322" valign="top">
<img src="cid:cibg_aee22c14-e9ed-4d7b-8c27-f6c4a26e7736.png" width="300" hspace="0" height="101" border="0"></td>
<td valign="top">
<p style="FONT-SIZE: 10pt; FONT-FAMILY: Arial; LINE-HEIGHT: normal"><span class="TitreCar"><b><span style="FONT-SIZE: 15pt; FONT-FAMILY: 'Calibri Light','sans-serif'; COLOR: #0080bf" lang="EN-US">Glenn Boschmans</span></b></span><br>
<span class="MsoSubtleReference"><span style="FONT-FAMILY: 'Calibri Light','sans-serif'; COLOR: #0a00be" lang="EN-US">Consultant</span></span><br>
<span style="FONT-SIZE: 11pt; FONT-FAMILY: 'Calibri Light','sans-serif'; COLOR: #164397" lang="EN-US">Business Integrated Solutions
</span><br>
<span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Calibri Light','sans-serif'" lang="EN-US">Kunstlaan 21, 1000 Brussel -
</span><span style="FONT-FAMILY: 'Calibri Light','sans-serif'; COLOR: #0080bf" lang="EN-US"><a href="http://cibg.brussels" target="_blank"><span style="FONT-SIZE: 10pt; COLOR: #0080bf">cibg.brussels</span></a></span><span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Calibri Light','sans-serif'" lang="EN-US">
 - </span><span style="FONT-FAMILY: 'Calibri Light','sans-serif'; COLOR: #0080bf" lang="EN-US"><a href="http://cibg.brussels/disclaimer-1" target="_blank"><span style="FONT-SIZE: 10pt; COLOR: #0080bf">disclaimer</span></a></span><br>
<span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Calibri Light','sans-serif'" lang="EN-US">+32 2 282 47 70<span style="COLOR: #fecb00"> | </span><span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Calibri Light', 'sans-serif'; COLOR: #000000"> 
<span style="COLOR: #000000"><br>
<span style="FONT-SIZE: 9pt; FONT-FAMILY: 'Calibri Light','sans-serif'; COLOR: #61c250" lang="EN-US">Be green, leave it on the screen !</span>                                                      
</span></span><a href="http://www.linkedin.com/company/cirb_cibg" target="_blank"><img src="cid:ln_e679eb12-caaa-4d0d-b64d-b39c820c309b.png" width="22" height="19" border="0"></a>  <a href="https://twitter.com/CIRB_CIBG" target="_blank"><img src="cid:tw_20cfb408-d952-4ea7-a757-a8716eaac012.png" width="19" height="19" border="0"></a>  <a href="http://www.leefmilieu.brussels/themas/duurzame-stad/label-ecodynamische-onderneming" target="_blank"><img src="cid:logo_eco_mail_e3e2fbdd-9cbf-4a5b-b0c1-1624e00ef4cd.jpg" hspace="0" border="0"></a></span><br data-mce-bogus="1"></p>
</td>
</tr>
</tbody>
</table>
</div>
</div>


<br>_______________________________________________<br>midPoint mailing list<br>midPoint@lists.evolveum.com<br>http://lists.evolveum.com/mailman/listinfo/midpoint<br></blockquote><div><br><br></div><div><br></div><div>-- <br></div><div><span name="x"></span>Ivan Noris<br>Senior Identity Engineer<br>evolveum.com<span name="x"></span><br></div></div></body></html>