From b10121de5e2a5455e25578b1af3f3599ab2717f3 Mon Sep 17 00:00:00 2001 From: Katarina Valalikova Date: Fri, 20 Apr 2018 08:41:17 +0200 Subject: [PATCH] fixing MID-4594 Nonce timestamp is not stored in User object --- .../web/page/forgetpassword/PageForgotPassword.java | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/gui/admin-gui/src/main/java/com/evolveum/midpoint/web/page/forgetpassword/PageForgotPassword.java b/gui/admin-gui/src/main/java/com/evolveum/midpoint/web/page/forgetpassword/PageForgotPassword.java index 4b8dc0fed12..19a1edee025 100644 --- a/gui/admin-gui/src/main/java/com/evolveum/midpoint/web/page/forgetpassword/PageForgotPassword.java +++ b/gui/admin-gui/src/main/java/com/evolveum/midpoint/web/page/forgetpassword/PageForgotPassword.java @@ -429,6 +429,8 @@ public UserType run() { private OperationResult saveUserNonce(final UserType user, final NonceCredentialsPolicyType noncePolicy) { return runPrivileged(new Producer() { + private static final long serialVersionUID = 1L; + @Override public OperationResult run() { Task task = createAnonymousTask("generateUserNonce"); @@ -440,13 +442,11 @@ public OperationResult run() { nonceCredentials .setClearValue(generateNonce(noncePolicy, task, user.asPrismObject(), result)); - NonceType nonceType = new NonceType(); - nonceType.setValue(nonceCredentials); - - ObjectDelta nonceDelta; +// NonceType nonceType = new NonceType(); +// nonceType.setValue(nonceCredentials); - nonceDelta = ObjectDelta.createModificationReplaceContainer(UserType.class, user.getOid(), - SchemaConstants.PATH_NONCE, getPrismContext(), nonceType); + ObjectDelta nonceDelta = ObjectDelta.createModificationReplaceProperty(UserType.class, user.getOid(), + SchemaConstants.PATH_NONCE_VALUE, getPrismContext(), nonceCredentials); WebModelServiceUtils.save(nonceDelta, result, task, PageForgotPassword.this); } catch (SchemaException | ExpressionEvaluationException | ObjectNotFoundException | CommunicationException | ConfigurationException | SecurityViolationException e) {