<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
</head>
<body text="#000000" bgcolor="#FFFFFF">
<p>Hi Mike,</p>
<p>variable event.focusPassword (or event.getFocusPassword() )
should contain the user password in userPasswordNotifier.</p>
<p>Please see
<a class="moz-txt-link-freetext" href="https://docs.evolveum.com/midpoint/reference/support-4.9/misc/notifications/configuration/">https://docs.evolveum.com/midpoint/reference/support-4.9/misc/notifications/configuration/</a>,
especially the chapter "Expression Variables" to see the most
important variables accessible in notifications.<br>
</p>
<p>Ivan<br>
</p>
<div class="moz-cite-prefix">On 21. 8. 2025 9:39, mikhail.nikolaenko
wrote:<br>
</div>
<blockquote type="cite"
cite="mid:qZ3BSYvLV6-i1t9ECK9SX4gqure2tLfqxtjEOulgPahhNC1ipwzfHKYKGhvSKU_mD8mtF8bYMp6I7tAiMN3dIozx6-bu0M7W0OS8iNKKDRA=@proton.me">
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<div style="font-family: Arial, sans-serif; font-size: 14px;">
<p>Here’s a polished version of your message with improved
grammar, clarity, and flow while keeping the tone professional
but friendly:</p>
<hr>
<p>Hi Ivan,</p>
<p>Thank you very much for the quick response! I used <code>accountPasswordNotifier</code>
as it appeared in many samples to notify users about their new
password. However, the <code>userPasswordNotifier</code> you
suggested does sound more appropriate. As I understand it, the
account password notifier is triggered for every account with
a password.</p>
<p>My problem, however, is that I haven’t found a way to access
the password in plain text. In the <code>accountPasswordNotifier</code>,
I use <code>event.plaintextPassword</code>, but this doesn’t
work in the user password notifier since the event object
doesn’t contain the <code>plaintextPassword</code> property.
I’ll try to investigate this further, perhaps with the
debugger, to see what kind of events and context are available
in this notifier.</p>
<p>Coming back to my main issue. After re-reading the
documentation you shared, I realized that filters can also be
used with password notifiers. So I added:</p>
<pre><code><b><i><operation>add</operation></i></b>
</code></pre>
<p>and now I’m getting exactly what I need out of the box.</p>
<p>So once I’m able to read the password from the <code>userPasswordNotifier</code>
context, I’ll have the complete solution.</p>
<p>Once again, thank you for your help.</p>
<p>Best regards,<br>
Mike</p>
<hr>
<p>Would you like me to make it <strong>slightly more concise</strong>
(business-like), or keep this <strong>friendly and detailed</strong>
tone?</p>
<div class="protonmail_quote"><br>
</div>
<div class="protonmail_quote"><br>
<div class="protonmail_quote">On Monday, August 18th, 2025 at
4:36 PM, Ivan Noris via midPoint
<a class="moz-txt-link-rfc2396E" href="mailto:midpoint@lists.evolveum.com"><midpoint@lists.evolveum.com></a> wrote:<br>
<blockquote class="protonmail_quote" type="cite">
<p>Hi Mike,</p>
<p>what about trying <b>userPasswordNotifier</b>? It is
very similar to accountPasswordNotifier, but it uses
midPoint password and not account password.</p>
<p>If you create users and generate their passwords in a
single step, this might well be what you want.</p>
<p>See also: <a class="moz-txt-link-freetext"
href="https://docs.evolveum.com/midpoint/guides/notifications-howto/"
target="_blank" rel="noreferrer nofollow noopener"
moz-do-not-send="true">https://docs.evolveum.com/midpoint/guides/notifications-howto/</a></p>
<p>Best regards,</p>
<p>Ivan<br>
</p>
<div class="moz-cite-prefix">On 18. 8. 2025 12:12,
mikhail.nikolaenko via midPoint wrote:<br>
</div>
<blockquote type="cite">
<p data-start="146" data-end="169">Hello dear community,</p>
<p data-start="171" data-end="359">We have the following
business requirement: when a new user is created, the
system must send a welcome email to their private
email address containing some text and the initial
password.</p>
<p data-start="361" data-end="513">My first idea was to
use <strong data-start="386" data-end="408">simpleUserNotifier</strong>
for the <b><em data-start="417" data-end="422">add</em>
</b>operation. However, I was not able to find a way
to access the newly generated password.</p>
<p data-start="515" data-end="698">As an alternative, I
used <strong data-start="541" data-end="568">accountPasswordNotifier</strong>,
and from there I can send the welcome email with the
password. This works, but now I need to ensure that it
happens only once.</p>
<p data-start="700" data-end="973">As soon as the email
is successfully sent (sure we could not be sure if it
was delivered, but at least send operation has been
completed without error), no further emails should be
triggered by password changes in midPoint. My first
thought was to follow a common approach by using a
custom attribute like <em data-start="896"
data-end="915">isWelcomeMailSent</em>, and setting
it to <em data-start="935" data-end="941">true</em>
once the email has been sent.</p>
<p data-start="975" data-end="1240">So my question is:
how can I modify a person attribute at the moment the
email is sent? Is it possible to do this directly from
the notification script? Or perhaps I was wrong, and
there is actually a way to access the new password in
the <em data-start="1214" data-end="1219">add</em>
operation context?</p>
<p data-start="1242" data-end="1264">Best regards,<br
data-start="1255" data-end="1258">
Mike</p>
<br>
<fieldset class="moz-mime-attachment-header"></fieldset>
<pre wrap="" class="moz-quote-pre">_______________________________________________
midPoint mailing list
<a class="moz-txt-link-abbreviated moz-txt-link-freetext"
href="mailto:midPoint@lists.evolveum.com"
rel="noreferrer nofollow noopener"
moz-do-not-send="true">midPoint@lists.evolveum.com</a>
<a class="moz-txt-link-freetext"
href="https://lists.evolveum.com/mailman/listinfo/midpoint"
target="_blank" rel="noreferrer nofollow noopener"
moz-do-not-send="true">https://lists.evolveum.com/mailman/listinfo/midpoint</a>
</pre>
</blockquote>
<pre class="moz-signature" cols="72">--
Ivan Noris
Expert Identity Engineer
evolveum.com
</pre>
</blockquote>
<br>
</div>
</div>
</div>
</blockquote>
<pre class="moz-signature" cols="72">--
Ivan Noris
Expert Identity Engineer
evolveum.com
</pre>
</body>
</html>