[midPoint] Notifications for email
Mario Civera Guillén
MCivera at computerspace.es
Mon Oct 15 13:44:48 CEST 2018
Hi,
I have configured the midpoint 3.6 using a docker container (valtri/docker-midpoint:3.6).
I need send email for password udpate or reset, but, I don't know why not email send
I have the following configuration, but I can not get it to work, if you can help me please.
Thank you
Security Policy
<?xml version="1.0" encoding="UTF-8"?>
<objects xmlns="http://midpoint.evolveum.com/xml/ns/public/common/common-3"
xmlns:c="http://midpoint.evolveum.com/xml/ns/public/common/common-3"
xmlns:org="http://midpoint.evolveum.com/xml/ns/public/common/org-3">
<securityPolicy xmlns="http://midpoint.evolveum.com/xml/ns/public/common/common-3"
xmlns:q="http://prism.evolveum.com/xml/ns/public/query-3"
xmlns:c="http://midpoint.evolveum.com/xml/ns/public/common/common-3"
xmlns:t="http://prism.evolveum.com/xml/ns/public/types-3"
xmlns:org="http://midpoint.evolveum.com/xml/ns/public/common/org-3"
xmlns:icfs="http://midpoint.evolveum.com/xml/ns/public/connector/icf-1/resource-schema-3"
xmlns:ri="http://midpoint.evolveum.com/xml/ns/public/resource/instance-3"
oid="267845-275-2854-0979-1b5295e15c80"
version="8">
<name>Security Policy</name>
<authentication>
<mailAuthentication>
<name>confirmationLink</name>
<displayName>Additional mail authnetication</displayName>
<mailNonce>mailNonce</mailNonce>
</mailAuthentication>
</authentication>
<credentials>
<nonce>
<maxAge>P90D</maxAge>
<lockoutMaxFailedAttempts>5</lockoutMaxFailedAttempts>
<lockoutFailedAttemptsDuration>PT15M</lockoutFailedAttemptsDuration>
<lockoutDuration>PT15M</lockoutDuration>
<valuePolicyRef xmlns:tns="http://midpoint.evolveum.com/xml/ns/public/common/common-3"
oid="267845-275-2854-0979-8b5295e36c30"
relation="org:default"
type="tns:ValuePolicyType"><!-- Password Policy--></valuePolicyRef>
</nonce>
</credentials>
<credentialsReset>
<mailReset>
<name>Reset password using mail</name>
<additionalAuthenticationName>confirmationLink</additionalAuthenticationName>
<formRef oid="bb42fa87-b066-48a0-a960-c77fc8b53737"
relation="org:default"
type="c:FormType"><!-- Reset password form --></formRef>
</mailReset>
</credentialsReset>
</securityPolicy>
</objects>
System Configuration
<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>
<accountPasswordNotifier>
<recipientExpression>
<script><code>requestee.getEmailAddress()</code></script>
</recipientExpression>
<transport>mail</transport>
</accountPasswordNotifier>
</handler>
<mail>
<server>
<host>smtp.gmail.com</host>
<port>587</port>
<username>xxxxx at gmail.com</username<mailto:xxxxx at gmail.com%3c/username>>
<password>
<t:encryptedData>
<t:encryptionMethod>
<t:algorithm>http://www.w3.org/2001/04/xmlenc#aes256-cbc</t:algorithm>
</t:encryptionMethod>
<t:keyInfo>
<t:keyName>dsdw309+39tG8Bi4XFWj5HQboes=</t:keyName>
</t:keyInfo>
<t:cipherData>
<t:cipherValue>nUkgLBb2fHeRIUL83fXpK7IrsSGtVfVW4jXijTvrzRg=</t:cipherValue>
</t:cipherData>
</t:encryptedData>
</password>
<transportSecurity>starttlsEnabled</transportSecurity>
</server>
<defaultFrom>xxxxx at gmail.com</defaultFrom<mailto:xxxxx at gmail.com%3c/defaultFrom>>
<debug>true</debug>
<redirectToFile>/var/log/tomcat8/mailredirect.log</redirectToFile>
</mail>
</notificationConfiguration>
Form reset password
<?xml version="1.0" encoding="UTF-8"?>
<form xmlns="http://midpoint.evolveum.com/xml/ns/public/common/common-3"
xmlns:q="http://prism.evolveum.com/xml/ns/public/query-3"
xmlns:c="http://midpoint.evolveum.com/xml/ns/public/common/common-3"
xmlns:t="http://prism.evolveum.com/xml/ns/public/types-3"
xmlns:icfs="http://midpoint.evolveum.com/xml/ns/public/connector/icf-1/resource-schema-3"
xmlns:ri="http://midpoint.evolveum.com/xml/ns/public/resource/instance-3"
oid="bb42fa87-b066-48a0-a960-c77fc8b53737"
version="1">
<name>Reset password form</name>
<formDefinition>
<display>
<label>Fill in required fields</label>
</display>
<formItems list="true">
<formField>
<binding>
<c:path>emailAddress</c:path>
</binding>
<display>
<label>Email</label>
<minOccurs>1</minOccurs>
</display>
</formField>
</formItems>
</formDefinition>
</form>
What I need is for you to notify me by email when the password is going to expire and the forget password part put the email and send you an email to reset it.
Thank you
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.evolveum.com/pipermail/midpoint/attachments/20181015/b318d9de/attachment.htm>
More information about the midPoint
mailing list