[midPoint] New User Password Creation Prompt

Sven Feyerabend Sven.Feyerabend at stuvus.uni-stuttgart.de
Wed Nov 29 11:32:47 CET 2023


Hi,

I use the self post-registration feature 
(https://docs.evolveum.com/midpoint/reference/support-4.8/misc/self-registration/)

For this I have a simpleUserNotifier:

<simpleUserNotifier>
     <operation>add</operation>
     <subjectExpression>
         <script>
             <code>
                 return 'Subject'
             </code>
         </script>
     </subjectExpression>
     <expressionFilter>
         <script>
             <code>
basic.stringify(requestee?.lifecycleState).equals('proposed')
             </code>
         </script>
     </expressionFilter>
     <recipientExpression>
         <script xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
                 xsi:type="c:ScriptExpressionEvaluatorType">
             <code>
                 return requestee.getEmailAddress()
             </code>
         </script>
     </recipientExpression>
     <bodyExpression>
         <script xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
                 xsi:type="c:ScriptExpressionEvaluatorType">
             <code>
                 import 
com.evolveum.midpoint.notifications.api.events.ModelEvent

                 modelEvent = (ModelEvent) event
                 newUser = modelEvent.getFocusContext().getObjectNew();
                 userType = newUser.asObjectable();
                 link = midpoint.createInvitationLink(userType);
                 bodyMessage = // insert appropriate message containing 
the link
                 return bodyMessage;
             </code>
         </script>
     </bodyExpression>
     <transport>mail</transport>
</simpleUserNotifier>

Then I have an ObjectTemplate that ensures new Users are created with 
lifecycleState "proposed".
There is some additional configuration required, but that is the heart 
of it.

I hope this helps.

Kind regards,
Sven

Am 28.11.23 um 17:45 schrieb Drew Roberts via midPoint:
> What process do you guys use to prompt a newly created user to make a 
> password? I've tried doing something like
>
>     def user = (event as
>     ModelEvent).focusContext.objectNew?.asObjectable() as UserType
>     def link = midpoint.createAccountActivationLink(user)
>
> 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.
>
> -- 
> Drew Roberts  | Systems Administrator II
> IT Platform Engineering, Azusa Pacific University
> apu.edu <https://apu.edu>
>
> APU logo
>
> _______________________________________________
> midPoint mailing list
> midPoint at lists.evolveum.com
> https://lists.evolveum.com/mailman/listinfo/midpoint

-- 
Sven Feyerabend
Referent für IT-Betreuung
stuvus – Studierendenvertretung Universität Stuttgart
Pfaffenwaldring 5c
70569 Stuttgart
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.evolveum.com/pipermail/midpoint/attachments/20231129/94f7b7a0/attachment.htm>


More information about the midPoint mailing list