<html>
<head>
<meta content="text/html; charset=utf-8" http-equiv="Content-Type">
</head>
<body bgcolor="#FFFFFF" text="#000000">
<p>Hello Jason,</p>
<p>The Java code is almost OK - I would just change "> 0" to
">= 2" or ">= 4" (i.e. >=2, >=4) in first two
and the third line, respectively, in order to threat short
names/UIDnumber that would lead to IndexOutOfBoundsException.</p>
<p>And, as for the target path: It's hard to say. The way you've
chosen seems to be logical. This part of midPoint is not much
documented, so the only documentation is the code. And the code
that implements credentials mappings is quite old and in some
aspects not adequate (as I've learned recently), so it will be
probably changed in near future. Therefore we are on thin ice
here.</p>
<p>My suggestion: leave it as it is (if it's working). Maybe you
could test it on a user that has no password at all, if it works
also in this situation. And before any upgrade of midPoint (e.g.
to 3.4.1 or 3.5), just retest it.</p>
<p>I've created a JIRA issue for this (<a
href="https://jira.evolveum.com/browse/MID-3330">MID-3330</a>).
It's not a much work, but most probably it would require a request
of a subscriber or a little sponsoring.<br>
</p>
<p>Best regards,</p>
<pre class="moz-signature" cols="72">--
Pavol Mederly
Software developer
evolveum.com
</pre>
<br>
<div class="moz-cite-prefix">On 28.07.2016 21:02, Jason Everling
wrote:<br>
</div>
<blockquote
cite="mid:CAFkZXY78kK1zQMcy4dzad7G0btPR7KY-siFE-d4UeDYtG6d14w@mail.gmail.com"
type="cite">
<div dir="ltr">I need to generate new temp credentials for
returning users that have not used their account for years, most
of them do not remember their security questions or they have
changed mobile phone numbers so they cannot utilize our
forgotten password process.
<div><br>
</div>
<div>I have tested the below and it seems to be working, but
since I am not a java guru I am not 100% confident it is
correct. Can someone confirm? Mainly the target path</div>
<div><br>
</div>
<div> <!-- example josm5983 --></div>
<div>
<div style="font-size:12.8px"> <mapping></div>
<div style="font-size:12.8px"> <source></div>
<div style="font-size:12.8px">
<name>tmpGivenName</name></div>
<div style="font-size:12.8px">
<path>$user/givenName</path></div>
<div style="font-size:12.8px"> </source></div>
<div style="font-size:12.8px"> <source></div>
<div style="font-size:12.8px">
<name>tmpFamilyName</name></div>
<div style="font-size:12.8px">
<path>$user/familyName</path></div>
<div style="font-size:12.8px"> </source></div>
<div style="font-size:12.8px"> <source></div>
<div style="font-size:12.8px">
<name>tmpUidnumber</name></div>
<div style="font-size:12.8px"> <path></div>
<div style="font-size:12.8px"><span style="white-space:pre-wrap"> </span>declare
namespace bshp='<a moz-do-not-send="true"
href="http://midpoint.bshp.edu/schema/bshp"
target="_blank">http://midpoint.bshp.edu/schema/bshp</a>';</div>
<div style="font-size:12.8px"><span style="white-space:pre-wrap"> </span>$c:user/c:extension/bshp:uidnumber</div>
<div style="font-size:12.8px"><span style="white-space:pre-wrap"> </span></path></div>
<div style="font-size:12.8px"> </source></div>
<div style="font-size:12.8px"> <expression></div>
<div style="font-size:12.8px"> <script></div>
<div style="font-size:12.8px"> <code></div>
<div style="font-size:12.8px">
tmpGivenNameInit = basic.stringify(tmpGivenName)?.size()
> 0 ? (basic.stringify(tmpGivenName)).substring(0,2)
: ''</div>
<div style="font-size:12.8px"><span style="white-space:pre-wrap"> </span>tmpFamilyNameInit
= basic.stringify(tmpFamilyName)?.size() > 0 ?
(basic.stringify(tmpFamilyName)).substring(0,2) : ''</div>
<div style="font-size:12.8px"> <span style="white-space:pre-wrap"> </span>tmp<span
style="font-size:12.8px">tmpUidnumber</span>Init =
basic.stringify(<span style="font-size:12.8px">tmpUidnumber</span>)?.size()
> 0 ? (basic.stringify(<span style="font-size:12.8px">tmpUidnumber</span>)).substring(0,4)
: ''</div>
<div style="font-size:12.8px"><br>
</div>
<div style="font-size:12.8px">
newPasswd = basic.norm(tmpGivenNameInit + tmpFamilyNameInit
+ tmp<span style="font-size:12.8px">tmpUidnumber</span>Init)</div>
<div style="font-size:12.8px"><br>
</div>
<div style="font-size:12.8px">
basic.encrypt(newPasswd)</div>
<div style="font-size:12.8px"><span style="white-space:pre-wrap"> </span></code></div>
<div style="font-size:12.8px"> </script></div>
<div style="font-size:12.8px"> </expression></div>
<div style="font-size:12.8px"> <target></div>
<div style="font-size:12.8px">
<path>credentials/password/value</path></div>
<div style="font-size:12.8px"> </target></div>
<div style="font-size:12.8px"> </mapping></div>
</div>
</div>
<br>
<font size="2"><br>
<br>
CONFIDENTIALITY NOTICE:<br>
This e-mail together with any attachments is proprietary and
confidential; intended for only the recipient(s) named above and
may contain information that is privileged. You should not
retain, copy or use this e-mail or any attachments for any
purpose, or disclose all or any part of the contents to any
person. Any views or opinions expressed in this e-mail are those
of the author and do not represent those of the Baptist School
of Health Professions. If you have received this e-mail in
error, or are not the named recipient(s), you are hereby
notified that any review, dissemination, distribution or copying
of this communication is prohibited by the sender and to do so
might constitute a violation of the Electronic Communications
Privacy Act, 18 U.S.C. section 2510-2521. Please immediately
notify the sender and delete this e-mail and any attachments
from your computer. </font><br>
<br>
<fieldset class="mimeAttachmentHeader"></fieldset>
<br>
<pre wrap="">_______________________________________________
midPoint mailing list
<a class="moz-txt-link-abbreviated" href="mailto:midPoint@lists.evolveum.com">midPoint@lists.evolveum.com</a>
<a class="moz-txt-link-freetext" href="http://lists.evolveum.com/mailman/listinfo/midpoint">http://lists.evolveum.com/mailman/listinfo/midpoint</a>
</pre>
</blockquote>
<br>
</body>
</html>