Search in sources :

Example 1 with LdapOxAuthConfiguration

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

the class OrganizationService method getOxAuthSetting.

public LdapOxAuthConfiguration getOxAuthSetting(String configurationDn) {
    LdapOxAuthConfiguration ldapOxAuthConfiguration = null;
    try {
        configurationDn = configurationDn.replace("ou=oxtrust", "ou=oxauth");
        ldapOxAuthConfiguration = persistenceEntryManager.find(LdapOxAuthConfiguration.class, configurationDn);
        return ldapOxAuthConfiguration;
    } catch (BasePersistenceException ex) {
        log.error("Failed to load configuration from LDAP");
    }
    return null;
}
Also used : BasePersistenceException(org.gluu.persist.exception.BasePersistenceException) LdapOxAuthConfiguration(org.gluu.config.oxtrust.LdapOxAuthConfiguration)

Example 2 with LdapOxAuthConfiguration

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

the class JsonConfigurationService method saveOxAuthDynamicConfigJson.

public boolean saveOxAuthDynamicConfigJson(String oxAuthDynamicConfigJson) throws IOException {
    String configurationDn = configurationFactory.getConfigurationDn();
    LdapOxAuthConfiguration ldapOxAuthConfiguration = loadOxAuthConfig(configurationDn);
    ldapOxAuthConfiguration.setOxAuthConfigDynamic(oxAuthDynamicConfigJson);
    ldapOxAuthConfiguration.setRevision(ldapOxAuthConfiguration.getRevision() + 1);
    persistenceEntryManager.merge(ldapOxAuthConfiguration);
    return true;
}
Also used : LdapOxAuthConfiguration(org.gluu.config.oxtrust.LdapOxAuthConfiguration)

Example 3 with LdapOxAuthConfiguration

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

the class JsonConfigurationService method loadOxAuthConfig.

private LdapOxAuthConfiguration loadOxAuthConfig(String configurationDn) {
    try {
        configurationDn = configurationDn.replace("ou=oxtrust", "ou=oxauth");
        LdapOxAuthConfiguration conf = persistenceEntryManager.find(LdapOxAuthConfiguration.class, configurationDn);
        return conf;
    } catch (BasePersistenceException ex) {
        log.error("Failed to load configuration from LDAP");
    }
    return null;
}
Also used : BasePersistenceException(org.gluu.persist.exception.BasePersistenceException) LdapOxAuthConfiguration(org.gluu.config.oxtrust.LdapOxAuthConfiguration)

Aggregations

LdapOxAuthConfiguration (org.gluu.config.oxtrust.LdapOxAuthConfiguration)3 BasePersistenceException (org.gluu.persist.exception.BasePersistenceException)2