[midPoint] Need to generate username AND emailaddress, two separeate iterations

Kari Heikkilä kari.heikkila at qvantel.com
Thu Apr 6 20:54:59 CEST 2017


Oskar and Ivan,

thank you for quick responses.

I have now implemented own looping on mapping for emailAddress. Also I had to give up using midpoint iteration token for username/name to get emailAddress stored to user.
So both have now own looping on scripts on each template and I have unique values for both attributes!

Best regards,
Kari

From: midPoint [mailto:midpoint-bounces at lists.evolveum.com] On Behalf Of Oskar Butovic - AMI Praha a.s.
Sent: keskiviikko 5. huhtikuuta 2017 10.44
To: midPoint General Discussion <midpoint at lists.evolveum.com>
Subject: Re: [midPoint] Need to generate username AND emailaddress, two separeate iterations

Hi Kari,

as Ivan said there is only one iteration token in midpoint.

You can write script in expression in mapping which generates the email address. Something like this:

boolean unique = midpoint.isUniquePropertyValue(user, "emailAddress", resultAddress);
                    //log.info<http://log.info>("resultAddress" + resultAddress+ " isUnique " + unique);
                    while (!unique) {
                        customIterationToken = customIterationToken + 1;
                        resultAddress= primalResultName + customIterationToken;
                        polyStringResult = new PolyString(resultAddress);
                        unique = midpoint.isUniquePropertyValue(user, "emailAddress", resultAddress);
                        //log.info<http://log.info>("resultAddress" + resultAddress+ " isUnique " + unique);
                    }

Best Regards

Oskar Butovič

2017-04-04 20:48 GMT+02:00 Ivan Noris <ivan.noris at evolveum.com<mailto:ivan.noris at evolveum.com>>:

Hi Kari,

from what I know I think we have just one iteration token for whole User object for now. I think this issue may be for tracking this feature: https://jira.evolveum.com/browse/MID-1977 ("sponsoring needed").

You can have validation for any attribute to be unique in the object template, but unless someone corrects me, the iteration token is just one per user. (Schema suggests so as well.)

Regards,

Ivan

On 04/04/2017 02:06 PM, Kari Heikkilä wrote:
Hello,

setting up midPoint and phasing difficulties on username + email address generation.

I have had (unique) username generation working nicely (using iteration feature.
I need also generate unique primary email address for the new user.
Our policies for usernames  and email addresses  are such that username and email address may need different amount of iteration cycles to achieve uniqueness,
like username needing two cycles and email address only one cycle.

My problem now is that I seem to get only one iteration loop and iterations are stop after both are found to be unique.
Templates generation these are launched from resource synchronization unmatched situation.

Is it possible to generate unique username and email address on separate loops?
If yes any pointers to documentation are welcome.

Best regards,
Kari
--
Qvantel Finland
System developer – integrations





_______________________________________________

midPoint mailing list

midPoint at lists.evolveum.com<mailto:midPoint at lists.evolveum.com>

http://lists.evolveum.com/mailman/listinfo/midpoint



--

Ivan Noris

Senior Identity Engineer

evolveum.com<http://evolveum.com>

_______________________________________________
midPoint mailing list
midPoint at lists.evolveum.com<mailto:midPoint at lists.evolveum.com>
http://lists.evolveum.com/mailman/listinfo/midpoint



--

Oskar Butovič
solution architect

gsm: [+420] 774 480 101
e-mail: oskar.butovic at ami.cz<mailto:oskar.butovic at ami.cz>






AMI Praha a.s.
Pláničkova 11
162 00 Praha 6
tel.: [+420] 274 783 239
web: www.ami.cz<http://www.ami.cz/>






[AMI Praha a.s.]


[AMI Praha a.s.]<http://www.ami.cz/reseni-a-sluzby/bezpecnost-dat/identity-management>


Textem tohoto e-mailu podepisující neslibuje uzavřít ani neuzavírá za společnost AMI Praha a.s.
jakoukoliv smlouvu. Každá smlouva, pokud bude uzavřena, musí mít výhradně písemnou formu.


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.evolveum.com/pipermail/midpoint/attachments/20170406/cb20012c/attachment.htm>


More information about the midPoint mailing list