From c71f7a8bc9b36d0631b4cf9534215e5620de532b Mon Sep 17 00:00:00 2001 From: Radovan Semancik Date: Wed, 2 Nov 2016 16:57:17 +0100 Subject: [PATCH] Improving the credentials schema --- .../page/login/PageRegistrationConfirmation.java | 4 ++-- .../web/page/login/PageSelfRegistration.java | 2 +- .../xml/ns/public/common/common-core-3.xsd | 13 ++++++++++++- 3 files changed, 15 insertions(+), 4 deletions(-) diff --git a/gui/admin-gui/src/main/java/com/evolveum/midpoint/web/page/login/PageRegistrationConfirmation.java b/gui/admin-gui/src/main/java/com/evolveum/midpoint/web/page/login/PageRegistrationConfirmation.java index 49e1a31de66..4701b2f6277 100644 --- a/gui/admin-gui/src/main/java/com/evolveum/midpoint/web/page/login/PageRegistrationConfirmation.java +++ b/gui/admin-gui/src/main/java/com/evolveum/midpoint/web/page/login/PageRegistrationConfirmation.java @@ -171,7 +171,7 @@ public OperationResult run() { private void assignAdditionalRoleIfPresent(String userOid, UsernamePasswordAuthenticationToken token, NonceType nonceType, OperationResult result){ SecurityContextHolder.getContext().setAuthentication(token); List userDeltas = new ArrayList<>(); - if (nonceType.getResetType() != null) { + if (nonceType.getName() != null) { Task task = createSimpleTask(OPERATION_FINISH_REGISTRATION); @@ -180,7 +180,7 @@ private void assignAdditionalRoleIfPresent(String userOid, UsernamePasswordAuthe try { AssignmentType assignment = new AssignmentType(); assignment.setTargetRef( - ObjectTypeUtil.createObjectRef(nonceType.getResetType(), ObjectTypes.ABSTRACT_ROLE)); + ObjectTypeUtil.createObjectRef(nonceType.getName(), ObjectTypes.ABSTRACT_ROLE)); getPrismContext().adopt(assignment); userDeltas.add((ItemDelta) ContainerDelta.createModificationAdd(UserType.F_ASSIGNMENT, UserType.class, getPrismContext(), assignment)); diff --git a/gui/admin-gui/src/main/java/com/evolveum/midpoint/web/page/login/PageSelfRegistration.java b/gui/admin-gui/src/main/java/com/evolveum/midpoint/web/page/login/PageSelfRegistration.java index e01ea4b7203..aeb660b4392 100644 --- a/gui/admin-gui/src/main/java/com/evolveum/midpoint/web/page/login/PageSelfRegistration.java +++ b/gui/admin-gui/src/main/java/com/evolveum/midpoint/web/page/login/PageSelfRegistration.java @@ -420,7 +420,7 @@ private UserType prepareUserToSave(Task task, if (namedParameters != null && !namedParameters.isEmpty()) { NamedPair firstParam = namedParameters.iterator().next(); if (firstParam != null) { - nonceType.setResetType(firstParam.getValue()); + nonceType.setName(firstParam.getValue()); } } } diff --git a/infra/schema/src/main/resources/xml/ns/public/common/common-core-3.xsd b/infra/schema/src/main/resources/xml/ns/public/common/common-core-3.xsd index 8930145b3b8..9bbea189cf4 100644 --- a/infra/schema/src/main/resources/xml/ns/public/common/common-core-3.xsd +++ b/infra/schema/src/main/resources/xml/ns/public/common/common-core-3.xsd @@ -2584,6 +2584,18 @@ + + + + Name of the credential. It is used as an identifier that + specifies credential purpose. E.g. it may specify whether + this is default user password or administration password, + whether this is a nonce for registration or password reset + and so on. Simply speaking the name is used to distinguish + credetials that have the same type but different purpose. + + + @@ -2664,7 +2676,6 @@ -