[midPoint] Simple question about password and Groovy

Wojciech Staszewski wojciech.staszewski at diagnostyka.pl
Sat Dec 3 19:20:01 CET 2016


8 hours of studying documentations and mailing list archves and.... Got it!
   *** midpoint.getPlaintextUserPassword(user).toString() ***

The script (maybe it will be usable for someone else):

import java.security.MessageDigest
def digest = MessageDigest.getInstance("MD5")
def clearpass = midpoint.getPlaintextUserPassword(user).toString()
def md5pass = new 
BigInteger(1,digest.digest(clearpass.getBytes())).toString(16).padLeft(32,"0")
return md5pass

THANK YOU!

Dnia sobota, 3 grudnia 2016 14:35:43 CET Wojciech Staszewski pisze:
> Hi!
> 
> How to pass password variable to Groovy script?
> 
> I have simple web application and almost configured "Table connector",
> everything is working except setting passwords, which are simple MD5 hashes.
> I made groovy script calculating MD5 hash and try to put this sctipt in
> outbound mapping. When I set static clear text as password variable it's
> work, but how to get password from $user/credentials/password?
> I was trying to use function "attributes.get()" but with no success.
> Any help? Thank you!
> _______________________________________________
> midPoint mailing list
> midPoint at lists.evolveum.com
> http://lists.evolveum.com/mailman/listinfo/midpoint




More information about the midPoint mailing list