<div dir="ltr"><div>Hey Sven, thanks! I'll give that a try.</div><div><br></div><div>Pascal, I actually made a mistake with my code example! I was trying so many things that I copied the wrong code snippet. I've actually been trying createPasswordResetLink and the token shows up as null so I get something like this: https://$host/midpoint/auth/passwordSet?user=testuser&token=null</div><div>I think the general notifier probably just doesn't work with createPasswordResetLink because the nonce doesn't get generated and added to the user credentials. I was hoping I could set something up so that when a user received a role, they would get prompted to make a password. Since there didn't seem to be a notifier/nonce setup for a first-time password setup I was messing with createPasswordResetLink. I suppose I could generate the nonce manually somehow, but I'm not sure what function would be needed to add the nonce credential to a user manually.<br></div><div><br></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Wed, Nov 29, 2023 at 2:33 AM Sven Feyerabend via midPoint <<a href="mailto:midpoint@lists.evolveum.com">midpoint@lists.evolveum.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><u></u>

  
    
  
  <div style="padding-bottom:1px">
    <p>Hi,</p>
    <p>I use the self post-registration feature
(<a href="https://docs.evolveum.com/midpoint/reference/support-4.8/misc/self-registration/" target="_blank">https://docs.evolveum.com/midpoint/reference/support-4.8/misc/self-registration/</a>)</p>
    <p>For this I have a simpleUserNotifier:</p>
    <p><simpleUserNotifier><br>
          <operation>add</operation><br>
          <subjectExpression><br>
              <script><br>
                  <code><br>
                      return 'Subject'<br>
                  </code><br>
              </script><br>
          </subjectExpression><br>
          <expressionFilter><br>
              <script><br>
                  <code><br>
                     
      basic.stringify(requestee?.lifecycleState).equals('proposed')<br>
                  </code><br>
              </script><br>
          </expressionFilter><br>
          <recipientExpression><br>
              <script
      xmlns:xsi=<a href="http://www.w3.org/2001/XMLSchema-instance" target="_blank">"http://www.w3.org/2001/XMLSchema-instance"</a><br>
                      xsi:type="c:ScriptExpressionEvaluatorType"><br>
                  <code><br>
                      return requestee.getEmailAddress()<br>
                  </code><br>
              </script><br>
          </recipientExpression><br>
          <bodyExpression><br>
              <script
      xmlns:xsi=<a href="http://www.w3.org/2001/XMLSchema-instance" target="_blank">"http://www.w3.org/2001/XMLSchema-instance"</a><br>
                      xsi:type="c:ScriptExpressionEvaluatorType"><br>
                  <code><br>
                      import
      com.evolveum.midpoint.notifications.api.events.ModelEvent<br>
      <br>
                      modelEvent = (ModelEvent) event<br>
                      newUser =
      modelEvent.getFocusContext().getObjectNew();<br>
                      userType = newUser.asObjectable();<br>
                      link = midpoint.createInvitationLink(userType);<br>
                      bodyMessage = // insert appropriate message
      containing the link<br>
                      return bodyMessage;<br>
                  </code><br>
              </script><br>
          </bodyExpression><br>
          <transport>mail</transport><br>
      </simpleUserNotifier><br>
    </p>
    <div>Then I have an ObjectTemplate that
      ensures new Users are created with lifecycleState "proposed".</div>
    <div>There is some additional configuration
      required, but that is the heart of it.</div>
    <div><br>
    </div>
    <div>I hope this helps.</div>
    <div><br>
    </div>
    <div>Kind regards,</div>
    <div>Sven<br>
    </div>
    <div><br>
    </div>
    <div>Am 28.11.23 um 17:45 schrieb Drew
      Roberts via midPoint:<br>
    </div>
    <blockquote type="cite">
      
      <div dir="ltr">What process do you guys use to prompt a newly
        created user to make a password? I've tried doing something like<br>
        <blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">def
          user = (event as
          ModelEvent).focusContext.objectNew?.asObjectable() as UserType<br>
          def link = midpoint.createAccountActivationLink(user)<br>
        </blockquote>
        inside a general notifier to send a mail nonce but I get a null
        token when I do that so I'm guessing I'm doing it wrong.<br clear="all">
        <br>
        <span class="gmail_signature_prefix">-- </span><br>
        <div dir="ltr" class="gmail_signature">
          <div dir="ltr">
            <div style="font-family:sans-serif;font-size:12px;line-height:1.5em"><span style="font-weight:bold">Drew Roberts</span>  |  <span style="font-weight:bold">Systems Administrator II</span><br>
              IT Platform Engineering, Azusa Pacific University<br>
              <a href="https://apu.edu" target="_blank">apu.edu</a> <br>
              <br>
              <img style="width: 210px;" src="https://www.apu.edu/static/src/sites/strategic-communication-engagement/images/apu_125_logo.png" alt="APU logo"></div>
          </div>
        </div>
      </div>
      <br>
      <fieldset></fieldset>
      <pre>_______________________________________________
midPoint mailing list
<a href="mailto:midPoint@lists.evolveum.com" target="_blank">midPoint@lists.evolveum.com</a>
<a href="https://lists.evolveum.com/mailman/listinfo/midpoint" target="_blank">https://lists.evolveum.com/mailman/listinfo/midpoint</a>
</pre>
    </blockquote>
    <pre cols="72">-- 
Sven Feyerabend
Referent für IT-Betreuung
stuvus – Studierendenvertretung Universität Stuttgart
Pfaffenwaldring 5c
70569 Stuttgart</pre>
  </div>
  <u></u><u></u>

_______________________________________________<br>
midPoint mailing list<br>
<a href="mailto:midPoint@lists.evolveum.com" target="_blank">midPoint@lists.evolveum.com</a><br>
<a href="https://lists.evolveum.com/mailman/listinfo/midpoint" rel="noreferrer" target="_blank">https://lists.evolveum.com/mailman/listinfo/midpoint</a><br>
</blockquote></div><br clear="all"><br><span class="gmail_signature_prefix">-- </span><br><div dir="ltr" class="gmail_signature"><div dir="ltr"><div style="font-family:sans-serif;font-size:12px;line-height:1.5em"><span style="font-weight:bold">Drew Roberts</span>  |  <span style="font-weight:bold">Systems Administrator II</span><br>IT Platform Engineering, Azusa Pacific University<br><a href="https://apu.edu" target="_blank">apu.edu</a> <br><br><img style="width: 210px;" src="https://www.apu.edu/static/src/sites/strategic-communication-engagement/images/apu_125_logo.png" alt="APU logo"></div></div></div>