Skip to content

Commit

Permalink
small update for reset password config
Browse files Browse the repository at this point in the history
  • Loading branch information
KaterynaHonchar committed Mar 29, 2023
1 parent 66a62b3 commit b4331a2
Showing 1 changed file with 31 additions and 24 deletions.
55 changes: 31 additions & 24 deletions docs/security/credentials/password-reset/index.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -270,30 +270,37 @@ Example for such configuration is shown in the following sample:
.Example for notification configuration
[source,xml]
----
<passwordResetNotifier>
<recipientExpression>
<script>
<code>return requestee.getEmailAddress()</code>
</script>
</recipientExpression>
<bodyExpression>
<script>
<code>
import com.evolveum.midpoint.notifications.api.events.ModelEvent
modelEvent = (ModelEvent) event
newUser = modelEvent.getFocusContext().getObjectNew();
userType = newUser.asObjectable();
link = midpoint.createPasswordResetLink(userType)
bodyMessage = "Did you request password reset? If yes, click on the link below \n" + link
return bodyMessage;
</code>
</script>
</bodyExpression>
<transport>mail</transport>
</passwordResetNotifier>
<notificationConfiguration>
<handler>
<passwordResetNotifier>
<recipientExpression>
<script>
<code>return requestee.getEmailAddress()</code>
</script>
</recipientExpression>
<bodyExpression>
<script>
<code>
import com.evolveum.midpoint.notifications.api.events.ModelEvent
modelEvent = (ModelEvent) event
newUser = modelEvent.getFocusContext().getObjectNew();
userType = newUser.asObjectable();
link = midpoint.createPasswordResetLink(userType)
bodyMessage = "Did you request password reset? If yes, click on the link bellow \n" + link
return bodyMessage;
</code>
</script>
</bodyExpression>
<transport>mail</transport>
</passwordResetNotifier>
</handler>
<mail>
<redirectToFile>mail.log</redirectToFile>
</mail>
</notificationConfiguration>
----

While using custom body expression don't forget to generate the link.
Expand Down

0 comments on commit b4331a2

Please sign in to comment.