<div dir="ltr">I am trying to implement:<div><a href="https://wiki.evolveum.com/display/midPoint/Reset+Password+Configuration">https://wiki.evolveum.com/display/midPoint/Reset+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.PrismProperty cannot be cast to com.evolveum.midpoint.prism.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">http://midpoint.evolveum.com/xml/ns/public/common/common-3</a>"</div><div>             xmlns:q="<a href="http://prism.evolveum.com/xml/ns/public/query-3">http://prism.evolveum.com/xml/ns/public/query-3</a>"</div><div>             xmlns:c="<a href="http://midpoint.evolveum.com/xml/ns/public/common/common-3">http://midpoint.evolveum.com/xml/ns/public/common/common-3</a>"</div><div>             xmlns:t="<a href="http://prism.evolveum.com/xml/ns/public/types-3">http://prism.evolveum.com/xml/ns/public/types-3</a>"</div><div>             xmlns:icfs="<a href="http://midpoint.evolveum.com/xml/ns/public/connector/icf-1/resource-schema-3">http://midpoint.evolveum.com/xml/ns/public/connector/icf-1/resource-schema-3</a>"</div><div>             xmlns:ri="<a href="http://midpoint.evolveum.com/xml/ns/public/resource/instance-3">http://midpoint.evolveum.com/xml/ns/public/resource/instance-3</a>"</div><div>             oid="c0c8a80d-1818-42d1-b3ad-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-06T19:56:44.233Z</createTimestamp></div><div>      <creatorRef oid="00000000-0000-0000-0000-000000000002" type="c:UserType"><!-- administrator --></creatorRef></div><div>      <createChannel><a href="http://midpoint.evolveum.com/xml/ns/public/model/channels-3#objectImport">http://midpoint.evolveum.com/xml/ns/public/model/channels-3#objectImport</a></createChannel></div><div>   </metadata></div><div>   <lifetime></div><div>      <expiration>999</expiration></div><div>      <warnBeforeExpiration>9</warnBeforeExpiration></div><div>      <lockAfterExpiration>0</lockAfterExpiration></div><div>      <minPasswordAge>0</minPasswordAge></div><div>      <passwordHistoryLength>0</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</minUniqueChars></div><div>         <limit></div><div>            <description>Alphas</description></div><div>            <minOccurs>1</minOccurs></div><div>            <mustBeFirst>false</mustBeFirst></div><div>            <characterClass></div><div>               <value>abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ</value></div><div>            </characterClass></div><div>         </limit></div><div>         <limit></div><div>            <description>Numbers</description></div><div>            <minOccurs>1</minOccurs></div><div>            <mustBeFirst>false</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">http://midpoint.evolveum.com/xml/ns/public/common/common-3</a>"</div><div>                xmlns:q="<a href="http://prism.evolveum.com/xml/ns/public/query-3">http://prism.evolveum.com/xml/ns/public/query-3</a>"</div><div>                xmlns:c="<a href="http://midpoint.evolveum.com/xml/ns/public/common/common-3">http://midpoint.evolveum.com/xml/ns/public/common/common-3</a>"</div><div>                xmlns:t="<a href="http://prism.evolveum.com/xml/ns/public/types-3">http://prism.evolveum.com/xml/ns/public/types-3</a>"</div><div>                xmlns:icfs="<a href="http://midpoint.evolveum.com/xml/ns/public/connector/icf-1/resource-schema-3">http://midpoint.evolveum.com/xml/ns/public/connector/icf-1/resource-schema-3</a>"</div><div>                xmlns:ri="<a href="http://midpoint.evolveum.com/xml/ns/public/resource/instance-3">http://midpoint.evolveum.com/xml/ns/public/resource/instance-3</a>"</div><div>                oid="28bf845a-b107-11e3-85bc-001e8c717e5b"</div><div>                version="19"></div><div>   <name>Mail Reset Security Policy</name></div><div>   <metadata></div><div>      <createTimestamp>2017-02-14T17:10:13.860Z</createTimestamp></div><div>      <creatorRef oid="00000000-0000-0000-0000-000000000002" type="c:UserType"><!-- administrator --></creatorRef></div><div>      <createChannel><a href="http://midpoint.evolveum.com/xml/ns/public/model/channels-3#objectImport">http://midpoint.evolveum.com/xml/ns/public/model/channels-3#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</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-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>         <additionalAuthenticationName>confirmationLink</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.notifications.api.events.ModelEvent</div><div>                    import com.evolveum.midpoint.xml.ns._public.common.common_3.OrgType</div><div>                    import com.evolveum.midpoint.prism.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">http://midpoint.evolveum.com/xml/ns/public/gui/channels-3#resetPassword</a>"))</div><div>            </code></div><div>        </script></div><div>    </expressionFilter></div><div>    <recipientExpression></div><div>        <script></div><div>            <code>return requestee.getEmailAddress()</code></div><div>        </script></div><div>    </recipientExpression></div><div>    <bodyExpression></div><div>        <script></div><div>            <code></div><div>                       </div><div>                import com.evolveum.midpoint.notifications.api.events.ModelEvent</div><div>                modelEvent = (ModelEvent) event</div><div>                newUser = modelEvent.getFocusContext().getObjectNew();</div><div>                userType = newUser.asObjectable();</div><div>     </div><div>                link = "<a href="http://localhost:8080/midpoint/resetPasswordConfrimation/user/">http://localhost:8080/midpoint/resetPasswordConfrimation/user/</a>" + userType.getName().getOrig() +"/token/" + midpoint.getPlaintext(userType.getCredentials().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>