[midPoint] Hook: detect change Password
Marco Benucci
m.benucci at nsr.it
Mon Nov 27 17:31:31 CET 2017
I found a solution myself:
delta = ObjectDelta.summarize(modelContext.getPrimaryChanges());
String nsCommon =
"http://midpoint.evolveum.com/xml/ns/public/common/common-3";
QName credentialQName = new QName(nsCommon, "credentials");
ItemPath pwdValuePath = new ItemPath(credentialQName,
CredentialsType.F_PASSWORD, PasswordType.F_VALUE);
if(delta.hasItemDelta(pwdValuePath)){
println("user has changed the password");
}
now it works.
On 11/27/2017 05:18 PM, Marco Benucci wrote:
>
> Hi,
>
> I'm running midPoint 3.6 and I'm playing with hooks.
>
> I'd like to detect when an user has changed his/her password using
> hooks and I have tried this without luck:
>
> delta = ObjectDelta.summarize(modelContext.getPrimaryChanges());
> QName pwdName = new
> QName("http://midpoint.evolveum.com/xml/ns/public/common/common-3",
> "credentials/password/value");
> ItemPath pwdPath = new ItemPath(pwdName);
> if(delta.hasItemDelta(pwdPath)){
> println("user has changed the password");
> }
>
>
> Is there a better way to do this..?
>
> Thank you.
>
>
>
>
> _______________________________________________
> midPoint mailing list
> midPoint at lists.evolveum.com
> http://lists.evolveum.com/mailman/listinfo/midpoint
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.evolveum.com/pipermail/midpoint/attachments/20171127/50c76cfe/attachment.htm>
More information about the midPoint
mailing list