[midPoint] resending self registration confirmation link
Gómez Martínez, Elsa
egomezm at minsait.com
Tue Apr 21 11:07:25 CEST 2020
Hello Oskar,
I am using the next form to reset the password user:
<form xmlns="http://midpoint.evolveum.com/xml/ns/public/common/common-3" xmlns:apti="http://midpoint.evolveum.com/xml/ns/public/common/api-types-3" xmlns:c="http://midpoint.evolveum.com/xml/ns/public/common/common-3" xmlns:icfs="http://midpoint.evolveum.com/xml/ns/public/connector/icf-1/resource-schema-3" xmlns:org="http://midpoint.evolveum.com/xml/ns/public/common/org-3" xmlns:q="http://prism.evolveum.com/xml/ns/public/query-3" xmlns:ri="http://midpoint.evolveum.com/xml/ns/public/resource/instance-3" xmlns:t="http://prism.evolveum.com/xml/ns/public/types-3" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" oid="d13a4fc9-1dc9-45bc-9212-9062e51559a7" version="1">
<name>Reset pass form</name>
<formDefinition>
<display xsi:type="c:FormDisplayType">
<label>Please fill in required fields</label>
</display>
<formItems list="true">
<formFieldGroup>
<formItems list="true">
<formField>
<binding>
<c:path>c:emailAddress</c:path>
</binding>
<display xsi:type="c:FormItemDisplayType">
<label>Email Address</label>
<help>Is used to finish registration process</help>
<minOccurs>1</minOccurs>
</display>
</formField>
</formItems>
</formFieldGroup>
</formItems>
</formDefinition>
</form>
To use it, I have to add the next code in the security policies file:
<credentialsReset>
<mailReset>
<name>Reset password using mail</name>
<additionalAuthenticationName>confirmationLink</additionalAuthenticationName>
<formRef oid="d13a4fc9-1dc9-45bc-9212-9062e51559a7" type="c:FormType"></formRef>
</mailReset>
</credentialsReset>
Finally, I have added the next piece of code in the system configuration file in <notificationConfiguration> tag:
<handler>
<passwordResetNotifier>
<recipientExpression>
<script xsi:type="c:ScriptExpressionEvaluatorType">
<code>return requestee.getEmailAddress()</code>
</script>
</recipientExpression>
<bodyExpression>
<script 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.createPasswordResetLink(userType).replaceAll('null','http://localhost:8080/midpoint');
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>
Hope it helps.
Elsa
De: midPoint <midpoint-bounces at lists.evolveum.com> En nombre de Oskar Butovic - AMI Praha a.s.
Enviado el: martes, 21 de abril de 2020 10:29
Para: midPoint General Discussion <midPoint at lists.evolveum.com>
Asunto: [midPoint] resending self registration confirmation link
Hello, midPoint community,
I was trying to trigger the resending of the self-registration confirmation link to force the users to set their passwords without knowing the previous one.
Changing the lifecycle state manually from the GUI didn't do the trick. What kind of event do I need to simulate in order to force link resending?
Thanks
Best Regards
Oskar Butovič
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.evolveum.com/pipermail/midpoint/attachments/20200421/60ddac3b/attachment.htm>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/pkcs7-signature
Size: 6049 bytes
Desc: not available
URL: <https://lists.evolveum.com/pipermail/midpoint/attachments/20200421/60ddac3b/attachment.bin>
More information about the midPoint
mailing list