[midPoint] Generate initial password for new user (mikhail.nikolaenko)

mikhail.nikolaenko mikhail.nikolaenko at proton.me
Sat Mar 15 11:29:21 CET 2025


Hello Jean Michel, Emil, and Ivan,

Thank you very much!

With best regards,
Mike




Sent with Proton Mail secure email.

On Friday, 14 March 2025 at 1:11 PM, Jean Michel via midPoint <midpoint at lists.evolveum.com> wrote:

> Hello Mikhail,
> 
> You must setup a userPasswordNotifier handler only for add operations on
> user's password attribute, inside a notificationConfiguration object,
> like so:
> 
> <notificationConfiguration>
> 
> <handler>
> 
> <userPasswordNotifier>
> 
> <operation>add</operation>
> 
> <transport>{PUT HERE THE TRANSPORT NAME}</transport>
> 
> <recipientExpression>
> 
> <script>
> 
> <code>
> 
> requestee.getEmailAddress()
> </code>
> 
> </script>
> 
> </recipientExpression>
> 
> <bodyExpression>
> 
> <script>
> 
> <code>
> 
> def message = "Hello, " +
> requestee.getGivenName().toString() + "\n\n"
> message += "Your new credentials are: \n\n"
> message += "login: " +
> requestee.getName().toString() + "\n"
> message += "email: " +
> requestee.getEmailAddress() + "\n"
> def password =
> midpoint.getPlaintextUserPassword(requestee) // Here you get the user's
> password as plain text
> message += "Initial password: " + password
> + "\n\n\n"
> 
> return message
> </code>
> 
> </script>
> 
> </bodyExpression>
> 
> </userPasswordNotifier>
> 
> </handler>
> 
> </notificationConfiguration>
> 
> 
> If you have any question, please let me know.
> 
> Best regards.
> 
> --
> Jean Michel S. A. dos Santos
> +55 (51) 4042-8153 / +55 (51) 3984-2645
> https://www.ebz.tec.br/
> 
> Em 14/03/2025 08:00, midpoint-request at lists.evolveum.com escreveu:
> 
> > Send midPoint mailing list submissions to
> > midpoint at lists.evolveum.com
> > 
> > To subscribe or unsubscribe via the World Wide Web, visit
> > https://lists.evolveum.com/mailman/listinfo/midpoint
> > or, via email, send a message with subject or body 'help' to
> > midpoint-request at lists.evolveum.com
> > 
> > You can reach the person managing the list at
> > midpoint-owner at lists.evolveum.com
> > 
> > When replying, please edit your Subject line so it is more specific
> > than "Re: Contents of midPoint digest..."
> > 
> > Today's Topics:
> > 
> > 1. Generate initial password for new user (mikhail.nikolaenko)
> > 2. Re: Generate initial password for new user (mikhail.nikolaenko)
> > 
> > ----------------------------------------------------------------------
> > 
> > Message: 1
> > Date: Fri, 14 Mar 2025 10:26:31 +0000
> > From: "mikhail.nikolaenko" mikhail.nikolaenko at proton.me
> > To: midPoint General Discussion midpoint at lists.evolveum.com
> > Subject: [midPoint] Generate initial password for new user
> > Message-ID:
> > sY2XckxGZRONa6JBfDweJ4B8WfH7iu_yvW1tfkDqBR0RvjUiINuG-ef4dbxT8bj5YCQCoSvexVyzvqJRSxYPiJ0gngPoEefQYcWpSlJmc-w=@proton.me
> > 
> > Content-Type: text/plain; charset="utf-8"
> > 
> > Hello!
> > Still learning midPoint to present a POC. Now I want to generate initial password for new employee based on pwd policy and also send it via email (means I need to have it stored on person object and be able to read it). I have checked docs and examples, but still could not understand how I can do this. May be someone can point me to the doc or give me a hint?
> > 
> > With best regards,
> > Mike
> > -------------- next part --------------
> > An HTML attachment was scrubbed...
> > URL: https://lists.evolveum.com/pipermail/midpoint/attachments/20250314/11acc9a7/attachment-0001.htm
> > 
> > ------------------------------
> > 
> > Message: 2
> > Date: Fri, 14 Mar 2025 10:32:18 +0000
> > From: "mikhail.nikolaenko" mikhail.nikolaenko at proton.me
> > To: midPoint General Discussion midpoint at lists.evolveum.com
> > Subject: Re: [midPoint] Generate initial password for new user
> > Message-ID:
> > 29Xwty72awJHXKpMV3O812ueOe5Icx63ipT-3aYe7i-w1gleIfqzIwJXVifBzwfcIF-18P-YGpFc0RWS08gRlcTsYMFrOkTnVouevTuzQjM=@proton.me
> > 
> > Content-Type: text/plain; charset="utf-8"
> > 
> > Sorry, that was easy:
> > 
> > Just in objectTemplate define the mapping like this:
> > 
> > <mapping id="25">
> > <name>credentials</name>
> > <expression>
> > <generate>
> > <valuePolicyRef oid="00000000-0000-0000-0000-000000000003" type="c:ValuePolicyType" xsi:type="c:ObjectReferenceType"/>
> > </generate>
> > </expression>
> > <target>
> > <path>c:credentials/password/value</path>
> > </target> </mapping>
> > 
> > WBR,
> > Mike
> > On Friday, 14 March 2025 at 11:26 AM, mikhail.nikolaenko via midPoint midpoint at lists.evolveum.com wrote:
> > 
> > > Hello!
> > > Still learning midPoint to present a POC. Now I want to generate initial password for new employee based on pwd policy and also send it via email (means I need to have it stored on person object and be able to read it). I have checked docs and examples, but still could not understand how I can do this. May be someone can point me to the doc or give me a hint?
> > > 
> > > With best regards,
> > > Mike
> > > -------------- next part --------------
> > > An HTML attachment was scrubbed...
> > > URL: https://lists.evolveum.com/pipermail/midpoint/attachments/20250314/1e06a2a6/attachment-0001.htm
> > 
> > ------------------------------
> > 
> > Subject: Digest Footer
> > 
> > _______________________________________________
> > midPoint mailing list
> > midPoint at lists.evolveum.com
> > https://lists.evolveum.com/mailman/listinfo/midpoint
> > 
> > ------------------------------
> > 
> > End of midPoint Digest, Vol 155, Issue 8
> > ****************************************
> 
> _______________________________________________
> midPoint mailing list
> midPoint at lists.evolveum.com
> https://lists.evolveum.com/mailman/listinfo/midpoint


More information about the midPoint mailing list