<div dir="ltr">Hi Peter<div><br></div><div>I successfully imported <span style="font-size:12.8px">Simple User Notifier snippet in midPoint 3.5. </span>What version do you try?</div><div>This feature is supported only from v3.5.<br></div><div><br></div><div><span style="font-size:12.8px">If you have same midPoint version, please send more detailed track trace from idm.log</span><br></div><div><span style="font-size:12.8px"><br></span></div><div><span style="font-size:12.8px">Best regards,</span></div><div><span style="font-size:12.8px"><br></span></div><div><span style="font-size:12.8px">Gustav</span></div></div><div class="gmail_extra"><br><div class="gmail_quote">2017-03-06 21:24 GMT+01:00 Peter Healy <span dir="ltr"><<a href="mailto:phealy3330@gmail.com" target="_blank">phealy3330@gmail.com</a>></span>:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">I am trying to implement:<div><a href="https://wiki.evolveum.com/display/midPoint/Reset+Password+Configuration" target="_blank">https://wiki.evolveum.com/<wbr>display/midPoint/Reset+<wbr>Password+Configuration</a><br></div><div><br></div><div>But I get an error importing the Simple User Notifier XML object that is in the wiki page:</div><div><span style="color:rgb(51,51,51);font-family:"source sans pro","helvetica neue",helvetica,arial,sans-serif;font-size:14px"><br></span></div><div><span style="color:rgb(51,51,51);font-family:"source sans pro","helvetica neue",helvetica,arial,sans-serif;font-size:14px">com.evolveum.midpoint.prism.<wbr>PrismProperty cannot be cast to com.evolveum.midpoint.prism.<wbr>PrismObject</span><br></div><div><span style="color:rgb(51,51,51);font-family:"source sans pro","helvetica neue",helvetica,arial,sans-serif;font-size:14px"><br></span></div><div><span style="color:rgb(51,51,51);font-family:"source sans pro","helvetica neue",helvetica,arial,sans-serif;font-size:14px"><br></span></div><div><span style="color:rgb(51,51,51);font-family:"source sans pro","helvetica neue",helvetica,arial,sans-serif;font-size:14px">I created and successfully imported this </span>Mail Nonce Policy:</div><div><div><valuePolicy xmlns="<a href="http://midpoint.evolveum.com/xml/ns/public/common/common-3" target="_blank">http://midpoint.<wbr>evolveum.com/xml/ns/public/<wbr>common/common-3</a>"</div><div>             xmlns:q="<a href="http://prism.evolveum.com/xml/ns/public/query-3" target="_blank">http://prism.<wbr>evolveum.com/xml/ns/public/<wbr>query-3</a>"</div><div>             xmlns:c="<a href="http://midpoint.evolveum.com/xml/ns/public/common/common-3" target="_blank">http://midpoint.<wbr>evolveum.com/xml/ns/public/<wbr>common/common-3</a>"</div><div>             xmlns:t="<a href="http://prism.evolveum.com/xml/ns/public/types-3" target="_blank">http://prism.<wbr>evolveum.com/xml/ns/public/<wbr>types-3</a>"</div><div>             xmlns:icfs="<a href="http://midpoint.evolveum.com/xml/ns/public/connector/icf-1/resource-schema-3" target="_blank">http://midpoint.<wbr>evolveum.com/xml/ns/public/<wbr>connector/icf-1/resource-<wbr>schema-3</a>"</div><div>             xmlns:ri="<a href="http://midpoint.evolveum.com/xml/ns/public/resource/instance-3" target="_blank">http://midpoint.<wbr>evolveum.com/xml/ns/public/<wbr>resource/instance-3</a>"</div><div>             oid="c0c8a80d-1818-42d1-b3ad-<wbr>e7f8993593a0"</div><div>             version="0"></div><div>   <name>Mail Nonce Policy</name></div><div>   <description>Mail Nonce Policy</description></div><div>   <metadata></div><div>      <createTimestamp>2017-03-<wbr>06T19:56:44.233Z</<wbr>createTimestamp></div><div>      <creatorRef oid="00000000-0000-0000-0000-<wbr>000000000002" type="c:UserType"><!-- administrator --></creatorRef></div><div>      <createChannel><a href="http://midpoint.evolveum.com/xml/ns/public/model/channels-3#objectImport" target="_blank">http://<wbr>midpoint.evolveum.com/xml/ns/<wbr>public/model/channels-3#<wbr>objectImport</a></createChannel></div><div>   </metadata></div><div>   <lifetime></div><div>      <expiration>999</expiration></div><div>      <warnBeforeExpiration>9</<wbr>warnBeforeExpiration></div><div>      <lockAfterExpiration>0</<wbr>lockAfterExpiration></div><div>      <minPasswordAge>0</<wbr>minPasswordAge></div><div>      <passwordHistoryLength>0</<wbr>passwordHistoryLength></div><div>   </lifetime></div><div>   <stringPolicy></div><div>      <description>Testing string policy</description></div><div>      <limitations></div><div>         <minLength>20</minLength></div><div>         <maxLength>20</maxLength></div><div>         <minUniqueChars>3</<wbr>minUniqueChars></div><div>         <limit></div><div>            <description>Alphas</<wbr>description></div><div>            <minOccurs>1</minOccurs></div><div>            <mustBeFirst>false</<wbr>mustBeFirst></div><div>            <characterClass></div><div>               <value><wbr>abcdefghijklmnopqrstuvwxyzABCD<wbr>EFGHIJKLMNOPQRSTUVWXYZ</value></div><div>            </characterClass></div><div>         </limit></div><div>         <limit></div><div>            <description>Numbers</<wbr>description></div><div>            <minOccurs>1</minOccurs></div><div>            <mustBeFirst>false</<wbr>mustBeFirst></div><div>            <characterClass></div><div>               <value>1234567890</value></div><div>            </characterClass></div><div>         </limit></div><div>      </limitations></div><div>   </stringPolicy></div><div></valuePolicy></div></div><div><br></div><div>And I successfully imported this security policy for the Mail reset:</div><div><div><securityPolicy xmlns="<a href="http://midpoint.evolveum.com/xml/ns/public/common/common-3" target="_blank">http://midpoint.<wbr>evolveum.com/xml/ns/public/<wbr>common/common-3</a>"</div><div>                xmlns:q="<a href="http://prism.evolveum.com/xml/ns/public/query-3" target="_blank">http://prism.<wbr>evolveum.com/xml/ns/public/<wbr>query-3</a>"</div><div>                xmlns:c="<a href="http://midpoint.evolveum.com/xml/ns/public/common/common-3" target="_blank">http://midpoint.<wbr>evolveum.com/xml/ns/public/<wbr>common/common-3</a>"</div><div>                xmlns:t="<a href="http://prism.evolveum.com/xml/ns/public/types-3" target="_blank">http://prism.<wbr>evolveum.com/xml/ns/public/<wbr>types-3</a>"</div><div>                xmlns:icfs="<a href="http://midpoint.evolveum.com/xml/ns/public/connector/icf-1/resource-schema-3" target="_blank">http://midpoint.<wbr>evolveum.com/xml/ns/public/<wbr>connector/icf-1/resource-<wbr>schema-3</a>"</div><div>                xmlns:ri="<a href="http://midpoint.evolveum.com/xml/ns/public/resource/instance-3" target="_blank">http://midpoint.<wbr>evolveum.com/xml/ns/public/<wbr>resource/instance-3</a>"</div><div>                oid="28bf845a-b107-11e3-85bc-<wbr>001e8c717e5b"</div><div>                version="19"></div><div>   <name>Mail Reset Security Policy</name></div><div>   <metadata></div><div>      <createTimestamp>2017-02-<wbr>14T17:10:13.860Z</<wbr>createTimestamp></div><div>      <creatorRef oid="00000000-0000-0000-0000-<wbr>000000000002" type="c:UserType"><!-- administrator --></creatorRef></div><div>      <createChannel><a href="http://midpoint.evolveum.com/xml/ns/public/model/channels-3#objectImport" target="_blank">http://<wbr>midpoint.evolveum.com/xml/ns/<wbr>public/model/channels-3#<wbr>objectImport</a></createChannel></div><div>   </metadata></div><div>   <authentication></div><div>      <mailAuthentication></div><div>         <name>confirmationLink</name></div><div>         <displayName>Additional mail authnetication</displayName></div><div>         <mailNonce>mailNonce</<wbr>mailNonce></div><div>      </mailAuthentication></div><div>   </authentication></div><div>   <credentials></div><div>      <nonce></div><div>         <maxAge>PT2M</maxAge></div><div>         <name>mailNonce</name></div><div>         <valuePolicyRef oid="c0c8a80d-1818-42d1-b3ad-<wbr>e7f8993593a0" type="c:ValuePolicyType"><!-- Mail Nonce Policy --></valuePolicyRef></div><div>      </nonce></div><div>   </credentials></div><div>   <credentialsReset></div><div>      <mailReset></div><div>         <name>Reset password using mail</name></div><div>         <<wbr>additionalAuthenticationName><wbr>confirmationLink</<wbr>additionalAuthenticationName></div><div>      </mailReset></div><div>   </credentialsReset></div><div></securityPolicy></div></div><div><br></div><div>This is the Simple User Notifier form the wiki page:</div><div><div><simpleUserNotifier></div><div>    <expressionFilter></div><div>        <script></div><div>            <code></div><div>                    import com.evolveum.midpoint.<wbr>notifications.api.events.<wbr>ModelEvent</div><div>                    import com.evolveum.midpoint.xml.ns._<wbr>public.common.common_3.OrgType</div><div>                    import com.evolveum.midpoint.prism.<wbr>delta.ChangeType</div><div>  </div><div>                   (event instanceof ModelEvent &amp;&amp; event.getChannel().equals("<a href="http://midpoint.evolveum.com/xml/ns/public/gui/channels-3#resetPassword" target="_blank">htt<wbr>p://midpoint.evolveum.com/xml/<wbr>ns/public/gui/channels-3#<wbr>resetPassword</a>"))</div><div>            </code></div><div>        </script></div><div>    </expressionFilter></div><div>    <recipientExpression></div><div>        <script></div><div>            <code>return requestee.getEmailAddress()</<wbr>code></div><div>        </script></div><div>    </recipientExpression></div><div>    <bodyExpression></div><div>        <script></div><div>            <code></div><div>                       </div><div>                import com.evolveum.midpoint.<wbr>notifications.api.events.<wbr>ModelEvent</div><div>                modelEvent = (ModelEvent) event</div><div>                newUser = modelEvent.getFocusContext().<wbr>getObjectNew();</div><div>                userType = newUser.asObjectable();</div><div>     </div><div>                link = "<a href="http://localhost:8080/midpoint/resetPasswordConfrimation/user/" target="_blank">http://localhost:8080/<wbr>midpoint/<wbr>resetPasswordConfrimation/<wbr>user/</a>" + userType.getName().getOrig() +"/token/" + midpoint.getPlaintext(<wbr>userType.getCredentials().<wbr>getNonce().getValue());</div><div>                bodyMessage = "Did you request password reset? If yes, click on the link bellow \n" + link</div><div>           </div><div>                return bodyMessage;</div><div>            </code></div><div>        </script></div><div>    </bodyExpression></div><div>    <transport>mail</transport></div><div></simpleUserNotifier></div></div></div>
<br>______________________________<wbr>_________________<br>
midPoint mailing list<br>
<a href="mailto:midPoint@lists.evolveum.com">midPoint@lists.evolveum.com</a><br>
<a href="http://lists.evolveum.com/mailman/listinfo/midpoint" rel="noreferrer" target="_blank">http://lists.evolveum.com/<wbr>mailman/listinfo/midpoint</a><br>
<br></blockquote></div><br><br clear="all"><div><br></div>-- <br><div class="gmail_signature" data-smartmail="gmail_signature"><div dir="ltr"><div>Gustáv Pálos</div><div>Identity Engineer</div><a href="http://evolveum.com/" rel="noreferrer" style="color:rgb(17,85,204);font-size:12.8px" target="_blank">evolveum.com</a><br></div></div>
</div>