<div dir="ltr">Hi Glenn,<div><br></div><div>please see Object template:</div><div><a href="https://wiki.evolveum.com/display/midPoint/Object+Template">https://wiki.evolveum.com/display/midPoint/Object+Template</a> and example.</div><div>In your case you need something like this:</div><div><br></div><div><div><span class="gmail-Apple-tab-span" style="white-space:pre">   </span><iteration></div><div><span class="gmail-Apple-tab-span" style="white-space:pre">              </span><maxIterations>999</maxIterations></div><div><span class="gmail-Apple-tab-span" style="white-space:pre">         </span><tokenExpression></div><div><span class="gmail-Apple-tab-span" style="white-space:pre">                        </span><script></div><div><span class="gmail-Apple-tab-span" style="white-space:pre">                         </span><code></div><div>                    if (iteration == 0) {</div><div>                    <span class="gmail-Apple-tab-span" style="white-space:pre">   </span>return "";</div><div>                    } else {</div><div>                    <span class="gmail-Apple-tab-span" style="white-space:pre">        </span>return "" + (iteration+1)</div><div>                    }</div><div>                </code></div><div><span class="gmail-Apple-tab-span" style="white-space:pre">                  </span></script></div><div><span class="gmail-Apple-tab-span" style="white-space:pre">                </span></tokenExpression></div><div><span class="gmail-Apple-tab-span" style="white-space:pre">       </span></iteration></div><div><br></div><div><span class="gmail-Apple-tab-span" style="white-space:pre">    </span><mapping></div><div><span class="gmail-Apple-tab-span" style="white-space:pre">                </span><name>Login name generator</name></div><div><span class="gmail-Apple-tab-span" style="white-space:pre">          </span><description>Generate login (user/name) as jsmith with iterator</description></div><div><span class="gmail-Apple-tab-span" style="white-space:pre">              </span><strength>weak</strength></div><div><span class="gmail-Apple-tab-span" style="white-space:pre">          </span><source></div><div><span class="gmail-Apple-tab-span" style="white-space:pre">                 </span><c:path>$user/givenName</c:path></div><div><span class="gmail-Apple-tab-span" style="white-space:pre">           </span></source></div><div><span class="gmail-Apple-tab-span" style="white-space:pre">                </span><source></div><div><span class="gmail-Apple-tab-span" style="white-space:pre">                 </span><c:path>$user/familyName</c:path></div><div><span class="gmail-Apple-tab-span" style="white-space:pre">          </span></source></div><div><span class="gmail-Apple-tab-span" style="white-space:pre">                </span><expression></div><div><span class="gmail-Apple-tab-span" style="white-space:pre">                     </span><script></div><div><span class="gmail-Apple-tab-span" style="white-space:pre">                         </span><code></div><div>                    return basic.norm(basic.stringify(givenName)).substring(0,1)+ basic.norm(basic.stringify(familyName))+ iterationToken<br></div><div>                </code></div><div><span class="gmail-Apple-tab-span" style="white-space:pre">                   </span></script></div><div><span class="gmail-Apple-tab-span" style="white-space:pre">                </span></expression></div><div><span class="gmail-Apple-tab-span" style="white-space:pre">            </span><target></div><div><span class="gmail-Apple-tab-span" style="white-space:pre">                 </span><c:path>name</c:path></div><div><span class="gmail-Apple-tab-span" style="white-space:pre">              </span></target></div><div><span class="gmail-Apple-tab-span" style="white-space:pre">        </span></mapping></div><div><br></div><div>iterationToken you need to generate logins like: gpalos, gpalos2, gpalos3, ... for namesakes</div><div class="gmail_extra"><br></div><div class="gmail_extra">Best regards,</div><div class="gmail_extra"><br></div><div class="gmail_extra">Gustav Palos</div><div class="gmail_extra"><br></div><div class="gmail_extra"><br><div class="gmail_quote">2017-05-15 15:36 GMT+02:00 BOSCHMANS Glenn <span dir="ltr"><<a href="mailto:gboschmans@cibg.brussels" target="_blank">gboschmans@cibg.brussels</a>></span>:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">





<div lang="NL-BE">
<div class="gmail-m_2397976542889087271WordSection1">
<p class="MsoNormal"><span lang="EN-US" style="font-size:9pt;font-family:arial,sans-serif">Hi all,<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:9pt;font-family:arial,sans-serif"><u></u> <u></u></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:9pt;font-family:arial,sans-serif">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.
<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:9pt;font-family:arial,sans-serif">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.<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:9pt;font-family:arial,sans-serif"><u></u> <u></u></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:9pt;font-family:arial,sans-serif">Is there a possibility in the schema handling to configure the first name and last name to generate a username? For example:<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:9pt;font-family:arial,sans-serif">accountFirstName: Glenn<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:9pt;font-family:arial,sans-serif">accountLastName: Boschmans<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:9pt;font-family:arial,sans-serif"><u></u> <u></u></span></p>
<p class="MsoNormal" style="margin-left:18pt"><span lang="EN-US" style="font-size:9pt;font-family:arial,sans-serif">-> $user/name: gboschmans<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:9pt;font-family:arial,sans-serif"><u></u> <u></u></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:9pt;font-family:arial,sans-serif">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.
<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:9pt;font-family:arial,sans-serif"><u></u> <u></u></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:9pt;font-family:arial,sans-serif">Any ideas?
<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:9pt;font-family:arial,sans-serif"><u></u> <u></u></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:9pt;font-family:arial,sans-serif">Thanks in advance!<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:9pt;font-family:arial,sans-serif"><u></u> <u></u></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:9pt;font-family:arial,sans-serif">Best regards,<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:9pt;font-family:arial,sans-serif">Glenn Boschmans<u></u><u></u></span></p>
</div>
<div lang="FR-BE">
<div class="gmail-m_2397976542889087271WordSection1">
<table border="0">
<tbody>
<tr>
<td style="border-right:thin solid rgb(254,203,0);width:306px" valign="top" width="322">
<img border="0" hspace="0" src="cid:cibg_aee22c14-e9ed-4d7b-8c27-f6c4a26e7736.png" width="300" height="101"></td>
<td valign="top">
<p style="font-size:10pt;font-family:arial;line-height:normal"><span class="gmail-m_2397976542889087271TitreCar"><b><span lang="EN-US" style="font-size:15pt;font-family:"calibri light",sans-serif;color:rgb(0,128,191)">Glenn Boschmans</span></b></span><br>
<span class="gmail-m_2397976542889087271MsoSubtleReference"><span lang="EN-US" style="font-family:"calibri light",sans-serif;color:rgb(10,0,190)">Consultant</span></span><br>
<span lang="EN-US" style="font-size:11pt;font-family:"calibri light",sans-serif;color:rgb(22,67,151)">Business Integrated Solutions
</span><br>
<span lang="EN-US" style="font-size:10pt;font-family:"calibri light",sans-serif">Kunstlaan 21, 1000 Brussel -
</span><span lang="EN-US" style="font-family:"calibri light",sans-serif;color:rgb(0,128,191)"><a href="http://cibg.brussels" target="_blank"><span style="font-size:10pt;color:rgb(0,128,191)">cibg.brussels</span></a></span><span lang="EN-US" style="font-size:10pt;font-family:"calibri light",sans-serif">
 - </span><span lang="EN-US" style="font-family:"calibri light",sans-serif;color:rgb(0,128,191)"><a href="http://cibg.brussels/disclaimer-1" target="_blank"><span style="font-size:10pt;color:rgb(0,128,191)">disclaimer</span></a></span><br>
<span lang="EN-US" style="font-size:10pt;font-family:"calibri light",sans-serif"><a href="tel:+32%202%20282%2047%2070" value="+3222824770" target="_blank">+32 2 282 47 70</a><span style="color:rgb(254,203,0)"> | </span><span style="font-size:10pt;font-family:"calibri light",sans-serif;color:rgb(0,0,0)"> 
<span style="color:rgb(0,0,0)"><br>
<span lang="EN-US" style="font-size:9pt;font-family:"calibri light",sans-serif;color:rgb(97,194,80)">Be green, leave it on the screen !</span>                             <wbr>                         
</span></span><a href="http://www.linkedin.com/company/cirb_cibg" target="_blank"><img border="0" src="cid:ln_e679eb12-caaa-4d0d-b64d-b39c820c309b.png" width="22" height="19"></a>  <a href="https://twitter.com/CIRB_CIBG" target="_blank"><img border="0" src="cid:tw_20cfb408-d952-4ea7-a757-a8716eaac012.png" width="19" height="19"></a>  <a href="http://www.leefmilieu.brussels/themas/duurzame-stad/label-ecodynamische-onderneming" target="_blank"><img border="0" hspace="0" src="cid:logo_eco_mail_e3e2fbdd-9cbf-4a5b-b0c1-1624e00ef4cd.jpg"></a></span></p>
</td>
</tr>
</tbody>
</table>
</div>
</div>
</div>

<br>______________________________<wbr>_________________<br>
midPoint mailing list<br>
<a href="mailto:midPoint@lists.evolveum.com">midPoint@lists.evolveum.com</a><br>
<a href="http://lists.evolveum.com/mailman/listinfo/midpoint" rel="noreferrer" target="_blank">http://lists.evolveum.com/<wbr>mailman/listinfo/midpoint</a><br>
<br></blockquote></div><br><br clear="all"><div><br></div>-- <br><div class="gmail_signature"><div dir="ltr"><div>Gustáv Pálos</div><div>Identity Engineer</div><a href="http://evolveum.com/" rel="noreferrer" style="color:rgb(17,85,204);font-size:12.8px" target="_blank">evolveum.com</a><br></div></div>
</div></div></div>