[midPoint] Generation of $user/name on reconcilitation of new account

Pálos Gustáv gustav.palos at evolveum.com
Mon May 15 16:02:29 CEST 2017


Hi Glenn,

please see Object template:
https://wiki.evolveum.com/display/midPoint/Object+Template and example.
In your case you need something like this:

<iteration>
<maxIterations>999</maxIterations>
<tokenExpression>
<script>
<code>
                    if (iteration == 0) {
                    return "";
                    } else {
                    return "" + (iteration+1)
                    }
                </code>
</script>
</tokenExpression>
</iteration>

<mapping>
<name>Login name generator</name>
<description>Generate login (user/name) as jsmith with
iterator</description>
<strength>weak</strength>
<source>
<c:path>$user/givenName</c:path>
</source>
<source>
<c:path>$user/familyName</c:path>
</source>
<expression>
<script>
<code>
                    return
basic.norm(basic.stringify(givenName)).substring(0,1)+
basic.norm(basic.stringify(familyName))+ iterationToken
                </code>
</script>
</expression>
<target>
<c:path>name</c:path>
</target>
</mapping>

iterationToken you need to generate logins like: gpalos, gpalos2, gpalos3,
... for namesakes

Best regards,

Gustav Palos


2017-05-15 15:36 GMT+02:00 BOSCHMANS Glenn <gboschmans at cibg.brussels>:

> Hi all,
>
>
>
> 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.
>
> 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.
>
>
>
> Is there a possibility in the schema handling to configure the first name
> and last name to generate a username? For example:
>
> accountFirstName: Glenn
>
> accountLastName: Boschmans
>
>
>
> -> $user/name: gboschmans
>
>
>
> 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.
>
>
>
> Any ideas?
>
>
>
> Thanks in advance!
>
>
>
> Best regards,
>
> Glenn Boschmans
>
> *Glenn Boschmans*
> Consultant
> Business Integrated Solutions
> Kunstlaan 21, 1000 Brussel - cibg.brussels - disclaimer
> <http://cibg.brussels/disclaimer-1>
> +32 2 282 47 70 <+32%202%20282%2047%2070> |
> Be green, leave it on the screen !
> <http://www.linkedin.com/company/cirb_cibg>
> <https://twitter.com/CIRB_CIBG>
> <http://www.leefmilieu.brussels/themas/duurzame-stad/label-ecodynamische-onderneming>
>
> _______________________________________________
> midPoint mailing list
> midPoint at lists.evolveum.com
> http://lists.evolveum.com/mailman/listinfo/midpoint
>
>


-- 
Gustáv Pálos
Identity Engineer
evolveum.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.evolveum.com/pipermail/midpoint/attachments/20170515/73384671/attachment.htm>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: logo_eco_mail_e3e2fbdd-9cbf-4a5b-b0c1-1624e00ef4cd.jpg
Type: image/jpeg
Size: 1260 bytes
Desc: not available
URL: <https://lists.evolveum.com/pipermail/midpoint/attachments/20170515/73384671/attachment.jpg>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: cibg_aee22c14-e9ed-4d7b-8c27-f6c4a26e7736.png
Type: image/png
Size: 11221 bytes
Desc: not available
URL: <https://lists.evolveum.com/pipermail/midpoint/attachments/20170515/73384671/attachment.png>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: ln_e679eb12-caaa-4d0d-b64d-b39c820c309b.png
Type: image/png
Size: 722 bytes
Desc: not available
URL: <https://lists.evolveum.com/pipermail/midpoint/attachments/20170515/73384671/attachment-0001.png>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: tw_20cfb408-d952-4ea7-a757-a8716eaac012.png
Type: image/png
Size: 464 bytes
Desc: not available
URL: <https://lists.evolveum.com/pipermail/midpoint/attachments/20170515/73384671/attachment-0002.png>


More information about the midPoint mailing list