@Override public AnyType getType() { return ApplicationContextProvider.getBeanFactory().getBean(AnyTypeDAO.class).findUser(); }
private boolean isPasswordMapped(final ExternalResource resource) { boolean result = false; Optional<? extends Provision> provision = resource.getProvision(anyTypeDAO.findUser()); if (provision.isPresent() && provision.get().getMapping() != null) { result = provision.get().getMapping().getItems().stream().anyMatch(item -> item.isPassword()); } return result; }
@PreAuthorize("isAuthenticated()") public TypeExtensionTO readTypeExtension(final String groupName) { Group group = groupDAO.findByName(groupName); if (group == null) { throw new NotFoundException("Group " + groupName); } Optional<? extends TypeExtension> typeExt = group.getTypeExtension(anyTypeDAO.findUser()); if (!typeExt.isPresent()) { throw new NotFoundException("TypeExtension in " + groupName + " for users"); } return groupDataBinder.getTypeExtensionTO(typeExt.get()); }
@Transactional(readOnly = true) public void addEntitlementsForAnyTypes() { for (AnyType anyType : anyTypeDAO.findAll()) { if (anyType != anyTypeDAO.findUser() && anyType != anyTypeDAO.findGroup()) { EntitlementsHolder.getInstance().addFor(anyType.getKey()); } } } }
protected boolean authenticate(final User user, final String password) { boolean authenticated = ENCRYPTOR.verify(password, user.getCipherAlgorithm(), user.getPassword()); LOG.debug("{} authenticated on internal storage: {}", user.getUsername(), authenticated); for (Iterator<? extends ExternalResource> itor = getPassthroughResources(user).iterator(); itor.hasNext() && !authenticated;) { ExternalResource resource = itor.next(); String connObjectKey = null; try { connObjectKey = mappingManager.getConnObjectKeyValue( user, resource.getProvision(anyTypeDAO.findUser()).get()).get(); Uid uid = connFactory.getConnector(resource).authenticate(connObjectKey, password, null); if (uid != null) { authenticated = true; } } catch (Exception e) { LOG.debug("Could not authenticate {} on {}", user.getUsername(), resource.getKey(), e); } LOG.debug("{} authenticated on {} as {}: {}", user.getUsername(), resource.getKey(), connObjectKey, authenticated); } return authenticated; }
protected boolean authenticate(final User user, final String password) { boolean authenticated = ENCRYPTOR.verify(password, user.getCipherAlgorithm(), user.getPassword()); LOG.debug("{} authenticated on internal storage: {}", user.getUsername(), authenticated); for (Iterator<? extends ExternalResource> itor = getPassthroughResources(user).iterator(); itor.hasNext() && !authenticated;) { ExternalResource resource = itor.next(); String connObjectKey = null; try { connObjectKey = mappingManager.getConnObjectKeyValue( user, resource.getProvision(anyTypeDAO.findUser()).get()).get(); Uid uid = connFactory.getConnector(resource).authenticate(connObjectKey, password, null); if (uid != null) { authenticated = true; } } catch (Exception e) { LOG.debug("Could not authenticate {} on {}", user.getUsername(), resource.getKey(), e); } LOG.debug("{} authenticated on {} as {}: {}", user.getUsername(), resource.getKey(), connObjectKey, authenticated); } return authenticated; }
boolean includeUser = resource.getProvision(anyTypeDAO.findUser()) != null; boolean includeGroup = resource.getProvision(anyTypeDAO.findGroup()) != null; boolean includeAnyObject = resource.getProvisions().stream().anyMatch(
} else { Optional<String> userKey = pullUtils.match( anyTypeDAO.findUser(), entry.getValue(), ghandler.getProfile().getTask().getResource(),
if (!anyType.equals(anyTypeDAO.findUser()) && !anyType.equals(anyTypeDAO.findGroup())) { AnyTypeCond anyTypeCond = new AnyTypeCond(); anyTypeCond.setAnyTypeKey(anyType.getKey());
if (userTemplate == null) { userTemplate = entityFactory.newEntity(SAML2UserTemplate.class); userTemplate.setAnyType(anyTypeDAO.findUser()); userTemplate.setIdP(idp); idp.setUserTemplate(userTemplate); anyTypeDAO.findUser().getClasses().forEach(anyTypeClass -> { allowedSchemas.getPlainSchemas().addAll(anyTypeClass.getPlainSchemas().stream(). map(Entity::getKey).collect(Collectors.toList()));
PLATFORM_INFO.getUserClasses().addAll(anyTypeDAO.findUser().getClasses().stream(). map(Entity::getKey).collect(Collectors.toList()));
if (userTemplate == null) { userTemplate = entityFactory.newEntity(OIDCUserTemplate.class); userTemplate.setAnyType(anyTypeDAO.findUser()); userTemplate.setOP(op); op.setUserTemplate(userTemplate); anyTypeDAO.findUser().getClasses().forEach(anyTypeClass -> { allowedSchemas.getPlainSchemas().addAll(anyTypeClass.getPlainSchemas().stream(). map(Entity::getKey).collect(Collectors.toList()));
protected Pair<TO, List<LogicActions>> beforeCreate(final TO input) { Realm realm = realmDAO.findByFullPath(input.getRealm()); if (realm == null) { SyncopeClientException sce = SyncopeClientException.build(ClientExceptionType.InvalidRealm); sce.getElements().add(input.getRealm()); throw sce; } AnyType anyType = input instanceof UserTO ? anyTypeDAO.findUser() : input instanceof GroupTO ? anyTypeDAO.findGroup() : anyTypeDAO.find(input.getType()); if (anyType == null) { SyncopeClientException sce = SyncopeClientException.build(ClientExceptionType.InvalidAnyType); sce.getElements().add(input.getType()); throw sce; } TO any = input; templateUtils.apply(any, realm.getTemplate(anyType)); List<LogicActions> actions = getActions(realm); for (LogicActions action : actions) { any = action.beforeCreate(any); } LOG.debug("Input: {}\nOutput: {}\n", input, any); return ImmutablePair.of(any, actions); }
setDynMembership(group, anyTypeDAO.findUser(), groupPatch.getUDynMembershipCond());
setDynMembership(group, anyTypeDAO.findUser(), groupTO.getUDynMembershipCond());
Mapping uMapping = provision.getAnyType().equals(anyTypeDAO.findUser()) ? provision.getMapping() : null;
options); Optional<? extends Provision> userProvision = provision.getResource().getProvision(anyTypeDAO.findUser()); boolean userIgnoreCaseMatch = userProvision.isPresent() ? userProvision.get().isIgnoreCaseMatch()