Search in sources :

Example 1 with DbApplicationConfiguration

use of org.gluu.config.oxtrust.DbApplicationConfiguration in project oxTrust by GluuFederation.

the class JsonConfigurationAction method init.

public String init() {
    try {
        log.debug("Loading oxauth-config.json and oxtrust-config.json");
        this.oxTrustappConfiguration = jsonConfigurationService.getOxTrustappConfiguration();
        this.oxTrustImportPersonConfiguration = jsonConfigurationService.getOxTrustImportPersonConfiguration();
        this.cacheConfiguration = jsonConfigurationService.getOxMemCacheConfiguration();
        if (this.cacheConfiguration.getRedisConfiguration().getPassword() != null) {
            decryptPassword(this.cacheConfiguration.getRedisConfiguration());
        }
        this.storeConfiguration = jsonConfigurationService.getDocumentStoreConfiguration();
        if (this.storeConfiguration.getJcaConfiguration().getPassword() != null) {
            decryptPassword(this.storeConfiguration.getJcaConfiguration());
        }
        this.oxTrustConfigJson = getProtectedOxTrustappConfiguration(this.oxTrustappConfiguration);
        this.oxTrustImportPersonConfigJson = getOxTrustImportPersonConfiguration(this.oxTrustImportPersonConfiguration);
        this.oxAuthDynamicConfigJson = getProtectedOxAuthAppConfiguration(this.jsonConfigurationService.getOxAuthDynamicConfigJson());
        this.cacheConfigurationJson = getCacheConfiguration(cacheConfiguration);
        this.storeConfigurationJson = getStoreConfiguration(storeConfiguration);
        DbApplicationConfiguration loadFido2Configuration = jsonConfigurationService.loadFido2Configuration();
        if (loadFido2Configuration != null) {
            this.fido2ConfigJson = loadFido2Configuration.getDynamicConf();
        }
        if ((this.oxTrustConfigJson != null) && (this.oxAuthDynamicConfigJson != null)) {
            return OxTrustConstants.RESULT_SUCCESS;
        }
    } catch (Exception ex) {
        log.error("Failed to load configuration from LDAP", ex);
        facesMessages.add(FacesMessage.SEVERITY_ERROR, "Failed to load configuration from LDAP");
    }
    conversationService.endConversation();
    return OxTrustConstants.RESULT_FAILURE;
}
Also used : DbApplicationConfiguration(org.gluu.config.oxtrust.DbApplicationConfiguration) EncryptionException(org.gluu.util.security.StringEncrypter.EncryptionException) InvocationTargetException(java.lang.reflect.InvocationTargetException)

Example 2 with DbApplicationConfiguration

use of org.gluu.config.oxtrust.DbApplicationConfiguration in project oxTrust by GluuFederation.

the class JsonConfigurationService method saveFido2Configuration.

public void saveFido2Configuration(String fido2ConfigJson) {
    DbApplicationConfiguration fido2Configuration = loadFido2Configuration();
    fido2Configuration.setDynamicConf(fido2ConfigJson);
    fido2Configuration.setRevision(fido2Configuration.getRevision() + 1);
    persistenceEntryManager.merge(fido2Configuration);
}
Also used : DbApplicationConfiguration(org.gluu.config.oxtrust.DbApplicationConfiguration)

Example 3 with DbApplicationConfiguration

use of org.gluu.config.oxtrust.DbApplicationConfiguration in project oxTrust by GluuFederation.

the class JsonConfigurationService method loadFido2Configuration.

public DbApplicationConfiguration loadFido2Configuration() {
    try {
        String configurationDn = configurationFactory.getBaseConfiguration().getString("fido2_ConfigurationEntryDN");
        DbApplicationConfiguration conf = persistenceEntryManager.find(DbApplicationConfiguration.class, configurationDn);
        return conf;
    } catch (BasePersistenceException ex) {
        log.error("Failed to load Fido2 configuration from LDAP");
    }
    return null;
}
Also used : BasePersistenceException(org.gluu.persist.exception.BasePersistenceException) DbApplicationConfiguration(org.gluu.config.oxtrust.DbApplicationConfiguration)

Aggregations

DbApplicationConfiguration (org.gluu.config.oxtrust.DbApplicationConfiguration)3 InvocationTargetException (java.lang.reflect.InvocationTargetException)1 BasePersistenceException (org.gluu.persist.exception.BasePersistenceException)1 EncryptionException (org.gluu.util.security.StringEncrypter.EncryptionException)1