<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
</head>
<body>
<p>Hello Frédéric,</p>
<p>unfortunately I have currently no time to analyze your specific
problem, but the issue you see with the delta builder is an
inherent limitation of that API. For more information and a
suggested workaround please see <a moz-do-not-send="true"
href="https://jira.evolveum.com/browse/MID-6981">https://jira.evolveum.com/browse/MID-6981</a>.</p>
<p>Best regards,<br>
</p>
<pre class="moz-signature" cols="72">--
Pavol Mederly
Software developer
evolveum.com</pre>
<div class="moz-cite-prefix">On 07/04/2021 17:27, Frédéric Lohier
via midPoint wrote:<br>
</div>
<blockquote type="cite"
cite="mid:CALRGK0rJi=m+7LJ3mFKbGDCWu+Owifw+gS8-dUR5mHsDz7xKpg@mail.gmail.com">
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<div dir="auto">
<div class="gmail_quote" dir="auto">
<div dir="ltr" class="gmail_attr">Hello,<br>
</div>
<div link="#0563C1" vlink="#954F72" lang="FR">
<div class="m_-9188281304109651004WordSection1">
<p class="MsoNormal"> </p>
<p class="MsoNormal">Following up my last email « Set
resource attribute pwdReset when password changed by
Midpoint GUI by IDM admin », I think the password
mapping using channels is the way to go.
</p>
<p class="MsoNormal">What I want to do now is to set this
attribute in the password mapping context using groovy.
This attribute exists in the resource schema as an
operational attribute and I can manualy set this
attribute for a user through midpoint GUI (edit
projection tab).</p>
<p class="MsoNormal"> </p>
<p class="MsoNormal">My guess is that I have to « build a
delta » for the correspondant shadow object. Am I right?</p>
<p class="MsoNormal"> </p>
<p class="MsoNormal">I know the shadow OID thanks to the
projection variable (projection.getOid()), I tried to
build the delta using some examples around, but I get
the error « Undefined or dynamic path: pwdReset in: CTD
({.../common/common-3}ShadowType) ». Any idea of what I
am doing wrong?</p>
<p class="MsoNormal"> </p>
<p class="MsoNormal">The full password mapping : </p>
<p class="MsoNormal"> </p>
<p class="MsoNormal"
style="line-height:14.25pt;background:#1e1e1e"><span
style="font-size:10.5pt;font-family:Consolas;color:gray"><</span><span
style="font-size:10.5pt;font-family:Consolas;color:#569cd6">credentials</span><span
style="font-size:10.5pt;font-family:Consolas;color:gray">></span><span
style="font-size:10.5pt;font-family:Consolas;color:#d4d4d4"></span></p>
<p class="MsoNormal"
style="line-height:14.25pt;background:#1e1e1e"><span
style="font-size:10.5pt;font-family:Consolas;color:#d4d4d4">
</span><span
style="font-size:10.5pt;font-family:Consolas;color:gray"><</span><span
style="font-size:10.5pt;font-family:Consolas;color:#569cd6">password</span><span
style="font-size:10.5pt;font-family:Consolas;color:gray">></span><span
style="font-size:10.5pt;font-family:Consolas;color:#d4d4d4"></span></p>
<p class="MsoNormal"
style="line-height:14.25pt;background:#1e1e1e"><span
style="font-size:10.5pt;font-family:Consolas;color:#d4d4d4">
</span><span
style="font-size:10.5pt;font-family:Consolas;color:gray"><</span><span
style="font-size:10.5pt;font-family:Consolas;color:#569cd6">outbound</span><span
style="font-size:10.5pt;font-family:Consolas;color:gray">></span><span
style="font-size:10.5pt;font-family:Consolas;color:#d4d4d4"></span></p>
<p class="MsoNormal"
style="line-height:14.25pt;background:#1e1e1e"><span
style="font-size:10.5pt;font-family:Consolas;color:#d4d4d4">
</span><span
style="font-size:10.5pt;font-family:Consolas;color:gray"><</span><span
style="font-size:10.5pt;font-family:Consolas;color:#569cd6">name</span><span
style="font-size:10.5pt;font-family:Consolas;color:gray">></span><span
style="font-size:10.5pt;font-family:Consolas;color:#d4d4d4">Password and pwdReset (to
force the password reset by user)</span><span
style="font-size:10.5pt;font-family:Consolas;color:gray"></</span><span
style="font-size:10.5pt;font-family:Consolas;color:#569cd6">name</span><span
style="font-size:10.5pt;font-family:Consolas;color:gray">></span><span
style="font-size:10.5pt;font-family:Consolas;color:#d4d4d4"></span></p>
<p class="MsoNormal"
style="line-height:14.25pt;background:#1e1e1e"><span
style="font-size:10.5pt;font-family:Consolas;color:#d4d4d4"> </span><span
style="font-size:10.5pt;font-family:Consolas;color:gray"><</span><span
style="font-size:10.5pt;font-family:Consolas;color:#569cd6">strength</span><span
style="font-size:10.5pt;font-family:Consolas;color:gray">></span><span
style="font-size:10.5pt;font-family:Consolas;color:#d4d4d4">strong</span><span
style="font-size:10.5pt;font-family:Consolas;color:gray"></</span><span
style="font-size:10.5pt;font-family:Consolas;color:#569cd6">strength</span><span
style="font-size:10.5pt;font-family:Consolas;color:gray">></span><span
style="font-size:10.5pt;font-family:Consolas;color:#d4d4d4"></span></p>
<p class="MsoNormal"
style="line-height:14.25pt;background:#1e1e1e"><span
style="font-size:10.5pt;font-family:Consolas;color:#d4d4d4"> </span><span
style="font-size:10.5pt;font-family:Consolas;color:gray"><</span><span
style="font-size:10.5pt;font-family:Consolas;color:#569cd6">channel</span><span
style="font-size:10.5pt;font-family:Consolas;color:gray">></span><span
style="font-size:10.5pt;font-family:Consolas;color:#d4d4d4"><a
href="http://midpoint.evolveum.com/xml/ns/public/gui/channels-3#user%3C/channel"
target="_blank" rel="noreferrer"
moz-do-not-send="true">http://midpoint.evolveum.com/xml/ns/public/gui/channels-3#user<span
style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:gray;text-decoration:none"></</span><span
style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#569cd6;text-decoration:none">c</span><span
style="color:#569cd6;text-decoration:none">hanne</span><span
style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#569cd6;text-decoration:none">l</span></a></span><span
style="font-size:10.5pt;font-family:Consolas;color:gray">></span><span
style="font-size:10.5pt;font-family:Consolas;color:#d4d4d4"></span></p>
<p class="MsoNormal"
style="line-height:14.25pt;background:#1e1e1e"><span
style="font-size:10.5pt;font-family:Consolas;color:#d4d4d4"> </span><span
style="font-size:10.5pt;font-family:Consolas;color:gray"><</span><span
style="font-size:10.5pt;font-family:Consolas;color:#569cd6">expression</span><span
style="font-size:10.5pt;font-family:Consolas;color:gray">></span><span
style="font-size:10.5pt;font-family:Consolas;color:#d4d4d4"></span></p>
<p class="MsoNormal"
style="line-height:14.25pt;background:#1e1e1e"><span
style="font-size:10.5pt;font-family:Consolas;color:#d4d4d4">
</span><span
style="font-size:10.5pt;font-family:Consolas;color:gray"><</span><span
style="font-size:10.5pt;font-family:Consolas;color:#569cd6">script</span><span
style="font-size:10.5pt;font-family:Consolas;color:gray">></span><span
style="font-size:10.5pt;font-family:Consolas;color:#d4d4d4"></span></p>
<p class="MsoNormal"
style="line-height:14.25pt;background:#1e1e1e"><span
style="font-size:10.5pt;font-family:Consolas;color:#d4d4d4">
</span><span
style="font-size:10.5pt;font-family:Consolas;color:gray"><</span><span
style="font-size:10.5pt;font-family:Consolas;color:#569cd6">code</span><span
style="font-size:10.5pt;font-family:Consolas;color:gray">></span><span
style="font-size:10.5pt;font-family:Consolas;color:#d4d4d4"></span></p>
<p class="MsoNormal"
style="line-height:14.25pt;background:#1e1e1e"><span
style="font-size:10.5pt;font-family:Consolas;color:#d4d4d4">
// If password modification comes from an Midpoint
admin (channel #user), then we set the Open LDAP
pwdReset attribute to TRUE (this will force the user
to reset his password)</span></p>
<p class="MsoNormal"
style="line-height:14.25pt;background:#1e1e1e"><span
style="font-size:10.5pt;font-family:Consolas;color:#d4d4d4"> </span></p>
<p class="MsoNormal"
style="line-height:14.25pt;background:#1e1e1e"><span
style="font-size:10.5pt;font-family:Consolas;color:#d4d4d4">
</span><span
style="font-size:10.5pt;font-family:Consolas;color:#d4d4d4">import com.evolveum.midpoint.prism.impl.delta.builder.*</span></p>
<p class="MsoNormal"
style="line-height:14.25pt;background:#1e1e1e"><span
style="font-size:10.5pt;font-family:Consolas;color:#d4d4d4">
import com.evolveum.midpoint.xml.ns._public.common.common_3.*</span></p>
<p class="MsoNormal"
style="line-height:14.25pt;background:#1e1e1e"><span
style="font-size:10.5pt;font-family:Consolas;color:#d4d4d4">
import com.evolveum.prism.xml.ns._public.types_3.*</span></p>
<p class="MsoNormal"
style="line-height:14.25pt;background:#1e1e1e"><span
style="font-size:10.5pt;font-family:Consolas;color:#d4d4d4"> </span></p>
<p class="MsoNormal"
style="line-height:14.25pt;background:#1e1e1e"><span
style="font-size:10.5pt;font-family:Consolas;color:#d4d4d4">
def prismContext = midpoint.getPrismContext()</span></p>
<p class="MsoNormal"
style="line-height:14.25pt;background:#1e1e1e"><span
style="font-size:10.5pt;font-family:Consolas;color:#d4d4d4">
def shadowOid = projection.getOid()</span></p>
<p class="MsoNormal"
style="line-height:14.25pt;background:#1e1e1e"><span
style="font-size:10.5pt;font-family:Consolas;color:#d4d4d4">
def delta = DeltaBuilder.deltaFor(ShadowType.class, prismContext)</span></p>
<p class="MsoNormal"
style="text-indent:35.4pt;line-height:14.25pt;background:#1e1e1e">
<span
style="font-size:10.5pt;font-family:Consolas;color:#d4d4d4">
.item(ShadowType.F_ATTRIBUTES, "pwdReset")</span></p>
<p class="MsoNormal"
style="line-height:14.25pt;background:#1e1e1e"><span
style="font-size:10.5pt;font-family:Consolas;color:#d4d4d4">
.add("TRUE")</span></p>
<p class="MsoNormal"
style="line-height:14.25pt;background:#1e1e1e"><span
style="font-size:10.5pt;font-family:Consolas;color:#d4d4d4">
.asObjectDelta(shadowOid)</span></p>
<p class="MsoNormal"
style="line-height:14.25pt;background:#1e1e1e"><span
style="font-size:10.5pt;font-family:Consolas;color:#d4d4d4">
midpoint.modifyObject(delta, null)</span></p>
<p class="MsoNormal"
style="line-height:14.25pt;background:#1e1e1e"><span
style="font-size:10.5pt;font-family:Consolas;color:#d4d4d4"> </span></p>
<p class="MsoNormal"
style="line-height:14.25pt;background:#1e1e1e"><span
style="font-size:10.5pt;font-family:Consolas;color:#d4d4d4">
// Then we return the password value anyway</span></p>
<p class="MsoNormal"
style="line-height:14.25pt;background:#1e1e1e"><span
style="font-size:10.5pt;font-family:Consolas;color:#d4d4d4"> return input</span></p>
<p class="MsoNormal"
style="line-height:14.25pt;background:#1e1e1e"><span
style="font-size:10.5pt;font-family:Consolas;color:#d4d4d4">
</span><span
style="font-size:10.5pt;font-family:Consolas;color:gray"></</span><span
style="font-size:10.5pt;font-family:Consolas;color:#569cd6">code</span><span
style="font-size:10.5pt;font-family:Consolas;color:gray">></span><span
style="font-size:10.5pt;font-family:Consolas;color:#d4d4d4"></span></p>
<p class="MsoNormal"
style="line-height:14.25pt;background:#1e1e1e"><span
style="font-size:10.5pt;font-family:Consolas;color:#d4d4d4">
</span><span
style="font-size:10.5pt;font-family:Consolas;color:gray"></</span><span
style="font-size:10.5pt;font-family:Consolas;color:#569cd6">script</span><span
style="font-size:10.5pt;font-family:Consolas;color:gray">></span><span
style="font-size:10.5pt;font-family:Consolas;color:#d4d4d4"></span></p>
<p class="MsoNormal"
style="line-height:14.25pt;background:#1e1e1e"><span
style="font-size:10.5pt;font-family:Consolas;color:#d4d4d4"> </span><span
style="font-size:10.5pt;font-family:Consolas;color:gray"></</span><span
style="font-size:10.5pt;font-family:Consolas;color:#569cd6">expression</span><span
style="font-size:10.5pt;font-family:Consolas;color:gray">></span><span
style="font-size:10.5pt;font-family:Consolas;color:#d4d4d4"></span></p>
<p class="MsoNormal"
style="line-height:14.25pt;background:#1e1e1e"><span
style="font-size:10.5pt;font-family:Consolas;color:#d4d4d4"> </span><span
style="font-size:10.5pt;font-family:Consolas;color:gray"></</span><span
style="font-size:10.5pt;font-family:Consolas;color:#569cd6">outbound</span><span
style="font-size:10.5pt;font-family:Consolas;color:gray">></span><span
style="font-size:10.5pt;font-family:Consolas;color:#d4d4d4"></span></p>
<p class="MsoNormal"
style="line-height:14.25pt;background:#1e1e1e"><span
style="font-size:10.5pt;font-family:Consolas;color:#d4d4d4"> </span><span
style="font-size:10.5pt;font-family:Consolas;color:gray"><</span><span
style="font-size:10.5pt;font-family:Consolas;color:#569cd6">outbound</span><span
style="font-size:10.5pt;font-family:Consolas;color:gray">></span><span
style="font-size:10.5pt;font-family:Consolas;color:#d4d4d4"></span></p>
<p class="MsoNormal"
style="line-height:14.25pt;background:#1e1e1e"><span
style="font-size:10.5pt;font-family:Consolas;color:#d4d4d4">
</span><span
style="font-size:10.5pt;font-family:Consolas;color:gray"><</span><span
style="font-size:10.5pt;font-family:Consolas;color:#569cd6">name</span><span
style="font-size:10.5pt;font-family:Consolas;color:gray">></span><span
style="font-size:10.5pt;font-family:Consolas;color:#d4d4d4"> Simple
password mapping</span><span
style="font-size:10.5pt;font-family:Consolas;color:gray"></</span><span
style="font-size:10.5pt;font-family:Consolas;color:#569cd6">name</span><span
style="font-size:10.5pt;font-family:Consolas;color:gray">></span></p>
<p class="MsoNormal"
style="line-height:14.25pt;background:#1e1e1e"><span
style="font-size:10.5pt;font-family:Consolas;color:#d4d4d4"> </span><span
style="font-size:10.5pt;font-family:Consolas;color:gray"><</span><span
style="font-size:10.5pt;font-family:Consolas;color:#569cd6">description</span><span
style="font-size:10.5pt;font-family:Consolas;color:gray">></span><span
style="font-size:10.5pt;font-family:Consolas;color:#d4d4d4">We apply
this mapping every time, except if the modification is
done on the Midpoint GUI (by an IDM admin)</span><span
style="font-size:10.5pt;font-family:Consolas;color:gray"></</span><span
style="font-size:10.5pt;font-family:Consolas;color:#569cd6">description</span><span
style="font-size:10.5pt;font-family:Consolas;color:gray">></span><span
style="font-size:10.5pt;font-family:Consolas;color:#d4d4d4"></span></p>
<p class="MsoNormal"
style="line-height:14.25pt;background:#1e1e1e"><span
style="font-size:10.5pt;font-family:Consolas;color:#d4d4d4"> </span><span
style="font-size:10.5pt;font-family:Consolas;color:gray"><</span><span
style="font-size:10.5pt;font-family:Consolas;color:#569cd6">strength</span><span
style="font-size:10.5pt;font-family:Consolas;color:gray">></span><span
style="font-size:10.5pt;font-family:Consolas;color:#d4d4d4">strong</span><span
style="font-size:10.5pt;font-family:Consolas;color:gray"></</span><span
style="font-size:10.5pt;font-family:Consolas;color:#569cd6">strength</span><span
style="font-size:10.5pt;font-family:Consolas;color:gray">></span><span
style="font-size:10.5pt;font-family:Consolas;color:#d4d4d4"></span></p>
<p class="MsoNormal"
style="line-height:14.25pt;background:#1e1e1e"><span
style="font-size:10.5pt;font-family:Consolas;color:#d4d4d4"> </span><span
style="font-size:10.5pt;font-family:Consolas;color:gray"><</span><span
style="font-size:10.5pt;font-family:Consolas;color:#569cd6">exceptChannel</span><span
style="font-size:10.5pt;font-family:Consolas;color:gray">></span><span
style="font-size:10.5pt;font-family:Consolas;color:#d4d4d4"><a
href="http://midpoint.evolveum.com/xml/ns/public/gui/channels-3#user%3C/exceptChannel"
target="_blank" rel="noreferrer"
moz-do-not-send="true">http://midpoint.evolveum.com/xml/ns/public/gui/channels-3#user<span
style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:gray;text-decoration:none"></</span><span
style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#569cd6;text-decoration:none">exceptChannel</span></a></span><span
style="font-size:10.5pt;font-family:Consolas;color:gray">></span><span
style="font-size:10.5pt;font-family:Consolas;color:#d4d4d4"></span></p>
<p class="MsoNormal"
style="line-height:14.25pt;background:#1e1e1e"><span
style="font-size:10.5pt;font-family:Consolas;color:#d4d4d4"> </span><span
style="font-size:10.5pt;font-family:Consolas;color:gray"></</span><span
style="font-size:10.5pt;font-family:Consolas;color:#569cd6">outbound</span><span
style="font-size:10.5pt;font-family:Consolas;color:gray">></span><span
style="font-size:10.5pt;font-family:Consolas;color:#d4d4d4"></span></p>
<p class="MsoNormal"
style="line-height:14.25pt;background:#1e1e1e"><span
style="font-size:10.5pt;font-family:Consolas;color:#d4d4d4"> </span><span
style="font-size:10.5pt;font-family:Consolas;color:gray"><</span><span
style="font-size:10.5pt;font-family:Consolas;color:#569cd6">inbound</span><span
style="font-size:10.5pt;font-family:Consolas;color:gray">/></span><span
style="font-size:10.5pt;font-family:Consolas;color:#d4d4d4"></span></p>
<p class="MsoNormal"
style="line-height:14.25pt;background:#1e1e1e"><span
style="font-size:10.5pt;font-family:Consolas;color:#d4d4d4"> </span><span
style="font-size:10.5pt;font-family:Consolas;color:gray"></</span><span
style="font-size:10.5pt;font-family:Consolas;color:#569cd6">password</span><span
style="font-size:10.5pt;font-family:Consolas;color:gray">></span><span
style="font-size:10.5pt;font-family:Consolas;color:#d4d4d4"></span></p>
<p class="MsoNormal"
style="line-height:14.25pt;background:#1e1e1e"><span
style="font-size:10.5pt;font-family:Consolas;color:gray"></</span><span
style="font-size:10.5pt;font-family:Consolas;color:#569cd6">credentials</span><span
style="font-size:10.5pt;font-family:Consolas;color:gray">></span><span
style="font-size:10.5pt;font-family:Consolas;color:#d4d4d4"></span></p>
<p class="MsoNormal"
style="line-height:14.25pt;background:#1e1e1e"><span
style="font-size:10.5pt;font-family:Consolas;color:#d4d4d4"> </span></p>
<p class="MsoNormal"
style="line-height:14.25pt;background:#1e1e1e"><span
style="font-size:10.5pt;font-family:Consolas;color:#d4d4d4"> </span></p>
<p class="MsoNormal"> </p>
<p class="MsoNormal">Error :</p>
<p class="MsoNormal"> </p>
<p class="MsoNormal">java.lang.IllegalArgumentException:
Undefined or dynamic path: pwdReset in: CTD
({.../common/common-3}ShadowType)</p>
<p class="MsoNormal"> at
com.evolveum.midpoint.prism.impl.delta.builder.DeltaBuilder.item(DeltaBuilder.java:92)</p>
<p class="MsoNormal"> at
com.evolveum.midpoint.prism.impl.delta.builder.DeltaBuilder.item(DeltaBuilder.java:85)</p>
<p class="MsoNormal"> at
java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native
Method)</p>
<p class="MsoNormal"> at
java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)</p>
<p class="MsoNormal"> at
java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)</p>
<p class="MsoNormal"> at
java.base/java.lang.reflect.Method.invoke(Method.java:566)</p>
<p class="MsoNormal"> at
org.codehaus.groovy.runtime.callsite.PlainObjectMetaMethodSite.doInvoke(PlainObjectMetaMethodSite.java:43)</p>
<p class="MsoNormal"> at
org.codehaus.groovy.runtime.callsite.PojoMetaMethodSite$PojoCachedMethodSite.invoke(PojoMetaMethodSite.java:188)</p>
<p class="MsoNormal"> at
org.codehaus.groovy.runtime.callsite.PojoMetaMethodSite.call(PojoMetaMethodSite.java:53)</p>
<p class="MsoNormal"> at
org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:47)</p>
<p class="MsoNormal"> at
org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:115)</p>
<p class="MsoNormal"> at
org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:127)</p>
<p class="MsoNormal"> at
expression_in_mapping_'Password_and_pwdReset_(to_force_the_password_reset_by_user)'_in_password_mapping_in_projection_(account_(default)_on_resource_xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx(LDAP)).run(expression
in mapping
'Password_and_pwdReset_(to_force_the_password_reset_by_user)'
in password mapping in projection (account (default) on
resource: xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx
(LDAP)):13)</p>
<p class="MsoNormal"> at
com.evolveum.midpoint.model.common.expression.script.groovy.GroovyScriptEvaluator.evaluateScript(GroovyScriptEvaluator.java:203)</p>
<p class="MsoNormal"> at
com.evolveum.midpoint.model.common.expression.script.groovy.GroovyScriptEvaluator.evaluateScript(GroovyScriptEvaluator.java:50)</p>
<p class="MsoNormal"> at
com.evolveum.midpoint.model.common.expression.script.AbstractCachingScriptEvaluator.evaluate(AbstractCachingScriptEvaluator.java:76)</p>
<p class="MsoNormal"> ... 36 common frames omitted</p>
</div>
</div>
</div>
</div>
<br>
<fieldset class="mimeAttachmentHeader"></fieldset>
<pre class="moz-quote-pre" wrap="">_______________________________________________
midPoint mailing list
<a class="moz-txt-link-abbreviated" href="mailto:midPoint@lists.evolveum.com">midPoint@lists.evolveum.com</a>
<a class="moz-txt-link-freetext" href="https://lists.evolveum.com/mailman/listinfo/midpoint">https://lists.evolveum.com/mailman/listinfo/midpoint</a>
</pre>
</blockquote>
</body>
</html>