use of org.gluu.oxtrust.model.GluuConfiguration in project oxTrust by GluuFederation.
the class ManagePersonAuthenticationAction method modifyImpl.
public String modifyImpl() {
if (this.initialized) {
return OxTrustConstants.RESULT_SUCCESS;
}
try {
GluuConfiguration configuration = configurationService.getConfiguration();
if (configuration == null) {
return OxTrustConstants.RESULT_FAILURE;
}
this.passportEnable = configuration.isPassportEnabled();
this.customScripts = customScriptService.findCustomScripts(Arrays.asList(CustomScriptType.PERSON_AUTHENTICATION), "displayName", "oxLevel", "oxEnabled");
List<OxIDPAuthConf> list = getIDPAuthConfOrNull(configuration);
this.sourceConfigs = new ArrayList<GluuLdapConfiguration>();
if (list != null) {
for (OxIDPAuthConf oxIDPAuthConf : list) {
GluuLdapConfiguration oxldapConfig = oxIDPAuthConf.getConfig();
this.sourceConfigs.add(oxldapConfig);
}
}
getAuthenticationRecaptcha();
this.authenticationMode = configuration.getAuthenticationMode();
this.oxTrustAuthenticationMode = configuration.getOxTrustAuthenticationMode();
} catch (Exception ex) {
log.error("Failed to load configuration configuration", ex);
return OxTrustConstants.RESULT_FAILURE;
}
this.initialized = true;
return OxTrustConstants.RESULT_SUCCESS;
}
use of org.gluu.oxtrust.model.GluuConfiguration in project oxTrust by GluuFederation.
the class ManagePersonAuthenticationAction method save.
public String save() throws IOException {
try {
// Reload entry to include latest changes
GluuConfiguration configuration = configurationService.getConfiguration();
boolean updateAuthenticationMode = false;
boolean updateOxTrustAuthenticationMode = false;
String oldAuthName = getFirstConfigName(configuration.getOxIDPAuthentication());
if (oldAuthName != null) {
if (oldAuthName.equals(this.authenticationMode)) {
updateAuthenticationMode = true;
}
if (oldAuthName.equals(this.oxTrustAuthenticationMode)) {
updateOxTrustAuthenticationMode = true;
}
}
updateAuthConf(configuration);
String newAuthName = getFirstConfigName(configuration.getOxIDPAuthentication());
String updatedAuthMode = updateAuthenticationMode ? newAuthName : this.authenticationMode;
String updatedOxTrustAuthMode = updateOxTrustAuthenticationMode ? newAuthName : this.oxTrustAuthenticationMode;
configuration.setAuthenticationMode(updatedAuthMode);
configuration.setOxTrustAuthenticationMode(updatedOxTrustAuthMode);
setAuthenticationRecaptcha();
configuration.setPassportEnabled(passportEnable);
configurationService.updateConfiguration(configuration);
} catch (BasePersistenceException ex) {
log.error("Failed to update configuration configuration", ex);
facesMessages.add(FacesMessage.SEVERITY_ERROR, "Failed to update configuration");
return OxTrustConstants.RESULT_FAILURE;
}
reset();
facesMessages.add(FacesMessage.SEVERITY_INFO, facesMessages.evalResourceAsString("#{msgs['configuration.manageAuthentication.updateSucceed']}"));
conversationService.endConversation();
return OxTrustConstants.RESULT_SUCCESS;
}
use of org.gluu.oxtrust.model.GluuConfiguration in project oxTrust by GluuFederation.
the class UpdateOrganizationAction method modifyOrganization.
private String modifyOrganization() {
if (this.organization != null) {
return OxTrustConstants.RESULT_SUCCESS;
}
try {
GluuOrganization tmpOrganization = organizationService.getOrganization();
this.organization = new GluuOrganization();
try {
PropertyUtils.copyProperties(this.organization, tmpOrganization);
} catch (Exception ex) {
log.error("Failed to load organization", ex);
this.organization = null;
}
} catch (BasePersistenceException ex) {
log.error("Failed to load organization", ex);
}
if (this.organization == null) {
return OxTrustConstants.RESULT_FAILURE;
}
this.loginPageCustomMessage = organizationService.getOrganizationCustomMessage(OxTrustConstants.CUSTOM_MESSAGE_LOGIN_PAGE);
this.welcomePageCustomMessage = organizationService.getOrganizationCustomMessage(OxTrustConstants.CUSTOM_MESSAGE_WELCOME_PAGE);
this.welcomeTitleText = organizationService.getOrganizationCustomMessage(OxTrustConstants.CUSTOM_MESSAGE_TITLE_TEXT);
initOxAuthSetting();
configurations = new ArrayList<GluuConfiguration>();
configurations.addAll(configurationService.getConfigurations());
return OxTrustConstants.RESULT_SUCCESS;
}
use of org.gluu.oxtrust.model.GluuConfiguration in project oxTrust by GluuFederation.
the class ConfigureLogViewerAction method updateConfiguration.
private void updateConfiguration() {
GluuConfiguration updateConfiguration = configurationService.getConfiguration();
try {
updateConfiguration.setOxLogViewerConfig(logViewerConfiguration);
updateConfiguration.setOxLogConfigLocation(oxTrustLogConfigLocation);
configurationService.updateConfiguration(updateConfiguration);
loggerService.resetLoggerConfigLocation();
} catch (Exception ex) {
log.error("Failed to save log viewer configuration '{}'", ex);
}
}
use of org.gluu.oxtrust.model.GluuConfiguration in project oxTrust by GluuFederation.
the class ManageCertificateAction method init.
public String init() {
if (this.initialized) {
return OxTrustConstants.RESULT_SUCCESS;
}
this.wereAnyChanges = false;
this.certsMmanagePossible = prepareTempWorkspace();
this.tomcatCertFN = orgInumFN + "-java.crt";
this.idpCertFN = orgInumFN + "-shib.crt";
try {
GluuConfiguration configuration = configurationService.getConfiguration();
if (configuration == null) {
return OxTrustConstants.RESULT_FAILURE;
}
trustStoreConfiguration = configuration.getTrustStoreConfiguration();
if (trustStoreConfiguration == null) {
trustStoreConfiguration = new TrustStoreConfiguration();
}
trustStoreCertificates = configuration.getTrustStoreCertificates();
if (trustStoreCertificates == null) {
trustStoreCertificates = new ArrayList<TrustStoreCertificate>();
}
} catch (Exception ex) {
log.error("Failed to load configuration configuration", ex);
return OxTrustConstants.RESULT_FAILURE;
}
this.initialized = true;
return OxTrustConstants.RESULT_SUCCESS;
}
Aggregations