public UserTemplateWizardBuilder( final TemplatableTO templatable, final List<String> anyTypeClasses, final UserFormLayoutInfo formLayoutInfo, final PageReference pageRef) { super(anyTypeClasses, formLayoutInfo, pageRef); this.templatable = templatable; if (templatable.getTemplates().containsKey(AnyTypeKind.USER.name())) { setItem(new UserWrapper(UserTO.class.cast(templatable.getTemplates().get(AnyTypeKind.USER.name())))); } else { UserTO userTO = new UserTO(); if (templatable instanceof RealmTO) { userTO.setRealm(String.format("'%s'", RealmTO.class.cast(templatable).getFullPath())); } setItem(new UserWrapper(userTO)); } }
@Transactional(propagation = Propagation.REQUIRES_NEW) public String create(final SAML2IdPEntity idp, final SAML2LoginResponseTO responseTO, final String nameID) { UserTO userTO = new UserTO(); if (idp.getUserTemplate() != null) { templateUtils.apply(userTO, idp.getUserTemplate()); } List<SAML2IdPActions> actions = getActions(idp); for (SAML2IdPActions action : actions) { userTO = action.beforeCreate(userTO, responseTO); } fill(idp.getKey(), responseTO, userTO); if (userTO.getRealm() == null) { userTO.setRealm(SyncopeConstants.ROOT_REALM); } if (userTO.getUsername() == null) { userTO.setUsername(nameID); } Pair<String, List<PropagationStatus>> created = provisioningManager.create(userTO, false, false); userTO = binder.getUserTO(created.getKey()); for (SAML2IdPActions action : actions) { userTO = action.afterCreate(userTO, responseTO); } return userTO.getUsername(); }
@Transactional(propagation = Propagation.REQUIRES_NEW) public String create(final OIDCProvider op, final OIDCLoginResponseTO responseTO, final String email) { UserTO userTO = new UserTO(); if (op.getUserTemplate() != null && op.getUserTemplate().get() != null) { templateUtils.apply(userTO, op.getUserTemplate().get()); } List<OIDCProviderActions> actions = getActions(op); for (OIDCProviderActions action : actions) { userTO = action.beforeCreate(userTO, responseTO); } fill(op, responseTO, userTO); if (userTO.getRealm() == null) { userTO.setRealm(SyncopeConstants.ROOT_REALM); } if (userTO.getUsername() == null) { userTO.setUsername(email); } Pair<String, List<PropagationStatus>> created = provisioningManager.create(userTO, false, false); userTO = binder.getUserTO(created.getKey()); for (OIDCProviderActions action : actions) { userTO = action.afterCreate(userTO, responseTO); } return userTO.getUsername(); }
userTO.setRealm(SyncopeConstants.ROOT_REALM); userTO.setKey(user.getId()); userTO.setPassword(user.getPassword());
userTO.setRealm(realmTO.getFullPath()); panel = new UserDirectoryPanel.Builder( anyTypeClassRestClient.list(anyTypeTO.getClasses()),