[ 
https://issues.apache.org/jira/browse/SYNCOPE-1453?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16802709#comment-16802709
 ] 

Dmitriy edited comment on SYNCOPE-1453 at 3/27/19 12:18 PM:
------------------------------------------------------------

Also, I wrote the custom attribute transformer for the AD.


{code:java}
public class MustChangePasswordItemTransformer implements ItemTransformer {

        private static final String ENABLED_PWD_LAST_SET_AD_VALUE = "0";

        @Override
        public List<PlainAttrValue> beforePropagation(Item item, Entity entity, 
List<PlainAttrValue> values) {
                return values;
        }

        @Override
        public List<Object> beforePull(Item item, EntityTO entityTO, 
List<Object> values) {
                if (values != null && !values.isEmpty() && values.get(0) != 
null) {
                        if 
(ENABLED_PWD_LAST_SET_AD_VALUE.equals(values.get(0))) {
                                List<Object> result = new ArrayList<>();
                                result.add("true");
                                return result;
                        }
                }

                return values;
        }
}
{code}



was (Author: dmitriy.brashevets):
Also, I wrote the custom attribute transformer for the AD.


{code:java}
@Transactional(readOnly = true)
public class MustChangePasswordItemTransformer implements ItemTransformer {

        private static final String ENABLED_PWD_LAST_SET_AD_VALUE = "0";

        @Override
        public List<PlainAttrValue> beforePropagation(Item item, Entity entity, 
List<PlainAttrValue> values) {
                return values;
        }

        @Override
        public List<Object> beforePull(Item item, EntityTO entityTO, 
List<Object> values) {
                if (values != null && !values.isEmpty() && values.get(0) != 
null) {
                        if 
(ENABLED_PWD_LAST_SET_AD_VALUE.equals(values.get(0))) {
                                List<Object> result = new ArrayList<>();
                                result.add("true");
                                return result;
                        }
                }

                return values;
        }
}
{code}


> MappingItem with "mustChangePassword" field cannot be provisioned and updated 
> during import
> -------------------------------------------------------------------------------------------
>
>                 Key: SYNCOPE-1453
>                 URL: https://issues.apache.org/jira/browse/SYNCOPE-1453
>             Project: Syncope
>          Issue Type: Bug
>          Components: core
>    Affects Versions: 2.0.12
>            Reporter: Dmitriy
>            Priority: Major
>          Time Spent: 20m
>  Remaining Estimate: 0h
>
> 1. Adding the mapping item into provisioning rules of the resource doesn't 
> allow to provision the updates made in 
> org.apache.syncope.common.lib.to.UserTO#mustChangePassword field.
> 2. Imported value from remote identity storage cannot be set to the already 
> existing user stored in the Syncope



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Reply via email to