<div dir="ltr">Hi Wojciech,<div><br></div><div>the code is sometimes passing null value (as the result of attributes?.get() call) to SecurityUtils.decrypt and there are two methods of this name in SecurityUtils. One takes GuardedByteArray and the other GuardedString as parameter.</div><div><br></div><div>As null has no type in java, the jvm does not know which method to call.</div><div><br></div><div>Check for null values before calling decrypt and you are ok.</div><div><br></div><div>arnost</div></div><br><div class="gmail_quote"><div dir="ltr">po 15. 10. 2018 v 22:04 odesílatel Wojciech Staszewski <<a href="mailto:wojciech.staszewski@diagnostyka.pl">wojciech.staszewski@diagnostyka.pl</a>> napsal:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hello!<br>
<br>
What can be the cause of this error message:<br>
<br>
Can't process shadow: null (OID:null): Generic error in connector:<br>
groovy.lang.GroovyRuntimeException(Ambiguous method overloading for<br>
method<br>
org.identityconnectors.common.security.SecurityUtil#decrypt.?Cannot<br>
resolve which method to invoke for [null] due to overlapping prototypes<br>
between:??[class<br>
org.identityconnectors.common.security.GuardedByteArray]??[class<br>
org.identityconnectors.common.security.GuardedString])<br>
<br>
This error shows up randomly in the reconciliation tasks and always is<br>
related to ScriptedSQL resources.<br>
<br>
I have outbound password mapping, this is the Groovy script part<br>
responsible for password handling:<br>
<br>
case "__PASSWORD__":<br>
// Read user password as clear text, then make sha1 hash with salt<br>
def SALT =<br>
org.apache.commons.lang.RandomStringUtils.randomAlphanumeric(8);<br>
def clearpass =<br>
SecurityUtil.decrypt(attributes?.get("__PASSWORD__")?.get(0)).toString()<br>
+ SALT;<br>
String.metaClass.toSHA1 = { salt = "" -><br>
def messageDigest = MessageDigest.getInstance("SHA1")<br>
messageDigest.update(salt.getBytes())<br>
messageDigest.update(delegate.getBytes())<br>
new BigInteger(1, messageDigest.digest()).toString(16).padLeft(40, '0')<br>
}<br>
sha1pass = clearpass.toSHA1('');<br>
sql.executeUpdate("UPDATE users SET password=?, salt=? WHERE<br>
user_id=?",[sha1pass,SALT,uid]);<br>
break;<br>
<br>
Thanks for any tips.<br>
Regards,<br>
WS<br>
<br>
-- <br>
Wojciech Staszewski<br>
Administrator Systemów Sieciowych<br>
<a href="http://www.diagnostyka.pl" rel="noreferrer" target="_blank">www.diagnostyka.pl</a><br>
Diagnostyka Sp. z o. o.<br>
ul. Prof. M. Życzkowskiego 16, 31-864 Kraków<br>
Numer KRS: 0000381559 (Sąd Rejonowy dla Krakowa-Śródmieścia w Krakowie, XI Wydział Gospodarczy KRS)<br>
NIP: 675-12-65-009; REGON: 356366975<br>
Kapitał zakładowy: 33 756 500 zł.<br>
<br>
Pomyśl o środowisku zanim wydrukujesz ten e-mail.<br>
<br>
_______________________________________________<br>
midPoint mailing list<br>
<a href="mailto:midPoint@lists.evolveum.com" target="_blank">midPoint@lists.evolveum.com</a><br>
<a href="http://lists.evolveum.com/mailman/listinfo/midpoint" rel="noreferrer" target="_blank">http://lists.evolveum.com/mailman/listinfo/midpoint</a><br>
</blockquote></div><br clear="all"><div><br></div>-- <br><div dir="ltr" class="gmail_signature" data-smartmail="gmail_signature"><div dir="ltr"><div><div dir="ltr"><p style="color:rgb(0,0,0);font-family:Verdana,Arial,Helvetica,sans-serif;font-size:10px"> </p><table style="font-family:Verdana,Arial,Helvetica,sans-serif;border-collapse:collapse;padding:0px;margin:0px;border-width:0px!important;border-style:solid!important;width:500px!important"><tbody><tr style="padding:0px;margin:0px;border:0px solid gray!important"><td style="color:rgb(0,0,0);font-family:Arial,sans-serif;font-size:13px;width:500px;vertical-align:bottom;padding:0px;border:0px solid gray!important"><strong>Arnošt Starosta</strong><br><span style="font-size:11px;color:rgb(128,128,128);border:0px solid gray!important">solution architect</span></td></tr><tr style="padding:0px;margin:0px;border:0px solid gray!important"><td style="color:rgb(0,0,0);font-family:Arial,sans-serif;font-size:11px;width:500px;height:11px;vertical-align:bottom;padding:0px;border:0px solid gray!important"> </td></tr><tr style="padding:0px;margin:0px;border:0px solid gray!important"><td style="color:rgb(0,0,0);font-family:Arial,sans-serif;font-size:11px;width:500px;vertical-align:bottom;padding:0px;border:0px solid gray!important">gsm: [+420] 603 794 932<br>e‑mail: <a href="mailto:arnost.starosta@ami.cz" target="_blank">arnost.starosta@ami.cz</a></td></tr><tr style="padding:0px;margin:0px;border:0px solid gray!important"><td style="color:rgb(0,0,0);font-family:Arial,sans-serif;font-size:11px;width:500px;height:20px;vertical-align:bottom;padding:0px;border:0px solid gray!important"> </td></tr><tr style="padding:0px;margin:0px;border:0px solid gray!important"><td style="color:rgb(0,0,0);font-family:Arial,sans-serif;font-size:11px;width:500px;vertical-align:bottom;padding:0px;border:0px solid gray!important"><strong>AMI Praha a.s.</strong><br>Pláničkova 11, 162 00 Praha 6</td></tr><tr style="padding:0px;margin:0px;border:0px solid gray!important"><td style="color:rgb(0,0,0);font-family:Arial,sans-serif;font-size:11px;width:500px;height:11px;vertical-align:bottom;padding:0px;border:0px solid gray!important"> </td></tr><tr style="padding:0px;margin:0px;border:0px solid gray!important"><td style="color:rgb(0,0,0);font-family:Arial,sans-serif;font-size:11px;width:500px;vertical-align:bottom;padding:0px;border:0px solid gray!important">tel.: [+420] 274 783 239 | web: <a href="http://dtp.ami.cz/www.ami.cz" target="_blank">www.ami.cz</a></td></tr><tr style="padding:0px;margin:0px;border:0px solid gray!important"><td style="color:rgb(0,0,0);font-family:Arial,sans-serif;font-size:11px;width:500px;height:25px;vertical-align:bottom;padding:0px;border:0px solid gray!important"> </td></tr><tr style="padding:0px;margin:0px;border:0px solid gray!important"><td style="color:rgb(0,0,0);font-family:Arial,sans-serif;font-size:11px;width:500px;vertical-align:bottom;padding:0px;border:0px solid gray!important"><img src="http://www.ami.cz/images/podpis/ami_logo.gif" alt="AMI Praha a.s." style="border:0px"></td></tr><tr style="padding:0px;margin:0px;border:0px solid gray!important"><td style="color:rgb(0,0,0);font-family:Arial,sans-serif;font-size:11px;width:500px;height:25px;vertical-align:bottom;padding:0px;border:0px solid gray!important"> </td></tr><tr style="padding:0px;margin:0px;border:0px solid gray!important"><td style="color:rgb(170,170,170);font-family:Arial,sans-serif;font-size:11px;width:500px;vertical-align:bottom;padding:0px;border:0px solid gray!important">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.</td></tr><tr style="padding:0px;margin:0px;border:0px solid gray!important"><td style="color:rgb(0,0,0);font-family:Arial,sans-serif;font-size:5px;width:500px;vertical-align:bottom;padding:0px;border:0px solid gray!important"> </td></tr><tr style="padding:0px;margin:0px;border:0px solid gray!important"><td style="color:rgb(170,170,170);font-family:Arial,sans-serif;font-size:11px;width:500px;vertical-align:bottom;padding:0px;border:0px solid gray!important">Tento e‑mail je určen výhradně pro potřeby jeho adresáta/ů a může obsahovat důvěrné nebo osobní informace. Nejste‑li zamýšleným příjemcem, je zakázáno jakékoliv zveřejňování, zprostředkování nebo jiné použití těchto informací. Pokud jste obdrželi e‑mail neoprávněně, informujte o tom prosím odesílatele a vymažte neprodleně všechny kopie tohoto e‑mailu včetně všech jeho příloh. Nakládáním s neoprávněně získanými informacemi se vystavujete riziku právního postihu.<br><br></td></tr></tbody></table></div></div></div></div>