if (task.getEntityKey() != null && task.getAnyTypeKind() != null) { switch (task.getAnyTypeKind()) { case USER: try { resources = userDAO.findAllResourceKeys(task.getEntityKey()); } catch (Exception e) { LOG.error("Could not read user {}", task.getEntityKey(), e); resources = groupDAO.findAllResourceKeys(task.getEntityKey()); } catch (Exception e) { LOG.error("Could not read group {}", task.getEntityKey(), e); default: try { resources = anyObjectDAO.findAllResourceKeys(task.getEntityKey()); } catch (Exception e) { LOG.error("Could not read any object {}", task.getEntityKey(), e);
@Transactional(readOnly = true) @Override public void before(final PropagationTask task, final ConnectorObject beforeObj) { if (AnyTypeKind.USER == task.getAnyTypeKind()) { User user = userDAO.find(task.getEntityKey()); if (user != null && user.getPassword() != null) { Attribute missing = AttributeUtil.find( PropagationTaskExecutor.MANDATORY_MISSING_ATTR_NAME, task.getAttributes()); ConnInstance connInstance = task.getResource().getConnector(); String cipherAlgorithm = getCipherAlgorithm(connInstance); if (missing != null && missing.getValue() != null && missing.getValue().size() == 1 && missing.getValue().get(0).equals(OperationalAttributes.PASSWORD_NAME) && cipherAlgorithmMatches(getCipherAlgorithm(connInstance), user.getCipherAlgorithm())) { String password = user.getPassword().toLowerCase(); byte[] decodedPassword = DatatypeConverter.parseHexBinary(password); String base64EncodedPassword = Base64.getEncoder().encodeToString(decodedPassword); String cipherPlusPassword = ("{" + cipherAlgorithm.toLowerCase() + "}" + base64EncodedPassword); Attribute passwordAttribute = AttributeBuilder.buildPassword( new GuardedString(cipherPlusPassword.toCharArray())); Set<Attribute> attributes = new HashSet<>(task.getAttributes()); attributes.add(passwordAttribute); attributes.remove(missing); task.setAttributes(attributes); } } } }
&& StringUtils.isNotBlank(provision.get().getMapping().getConnObjectLink())) { User user = userDAO.find(task.getEntityKey()); if (user != null) { List<String> groupConnObjectLinks = new ArrayList<>();
if (provision.getUidOnCreate() != null) { anyUtilsFactory.getInstance(task.getAnyTypeKind()). addAttr(task.getEntityKey(), provision.getUidOnCreate(), result.getUidValue());
@Transactional(readOnly = true) @Override public void before(final PropagationTask task, final ConnectorObject beforeObj) { if (AnyTypeKind.USER == task.getAnyTypeKind()) { User user = userDAO.find(task.getEntityKey()); if (user != null && user.getPassword() != null) { Attribute missing = AttributeUtil.find( PropagationTaskExecutor.MANDATORY_MISSING_ATTR_NAME, task.getAttributes()); ConnInstance connInstance = task.getResource().getConnector(); if (missing != null && missing.getValue() != null && missing.getValue().size() == 1 && missing.getValue().get(0).equals(OperationalAttributes.PASSWORD_NAME) && cipherAlgorithmMatches(getCipherAlgorithm(connInstance), user.getCipherAlgorithm())) { Attribute passwordAttribute = AttributeBuilder.buildPassword( new GuardedString(user.getPassword().toCharArray())); Set<Attribute> attributes = new HashSet<>(task.getAttributes()); attributes.add(passwordAttribute); attributes.remove(missing); Attribute hashedPasswordAttribute = AttributeBuilder.build( AttributeUtil.createSpecialName("HASHED_PASSWORD"), Boolean.TRUE); attributes.add(hashedPasswordAttribute); task.setAttributes(attributes); } } } }
Attribute attr = obj.getAttributeByName(item.getExtAttrName()); if (attr == null) { virAttrCache.expire(task.getAnyType(), task.getEntityKey(), item.getIntAttrName()); } else { VirAttrCacheValue cacheValue = new VirAttrCacheValue(); cacheValue.setValues(attr.getValue()); virAttrCache.put(task.getAnyType(), task.getEntityKey(), item.getIntAttrName(), cacheValue);
propagationTaskTO.setAnyTypeKind(propagationTask.getAnyTypeKind()); propagationTaskTO.setAnyType(propagationTask.getAnyType()); propagationTaskTO.setEntityKey(propagationTask.getEntityKey()); break;