Search in sources :

Example 1 with LdapOxAuthConfiguration

use of org.xdi.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 = ldapEntryManager.find(LdapOxAuthConfiguration.class, configurationDn);
        return conf;
    } catch (LdapMappingException ex) {
        log.error("Failed to load configuration from LDAP");
    }
    return null;
}
Also used : LdapMappingException(org.gluu.site.ldap.persistence.exception.LdapMappingException) LdapOxAuthConfiguration(org.xdi.config.oxtrust.LdapOxAuthConfiguration)

Example 2 with LdapOxAuthConfiguration

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

the class JsonConfigurationService method saveOxAuthDynamicConfigJson.

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

Example 3 with LdapOxAuthConfiguration

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

the class JsonConfigurationService method getOxAuthDynamicConfigJson.

public String getOxAuthDynamicConfigJson() throws JsonGenerationException, JsonMappingException, IOException {
    String configurationDn = configurationFactory.getConfigurationDn();
    LdapOxAuthConfiguration ldapOxAuthConfiguration = loadOxAuthConfig(configurationDn);
    return ldapOxAuthConfiguration.getOxAuthConfigDynamic();
}
Also used : LdapOxAuthConfiguration(org.xdi.config.oxtrust.LdapOxAuthConfiguration)

Aggregations

LdapOxAuthConfiguration (org.xdi.config.oxtrust.LdapOxAuthConfiguration)3 LdapMappingException (org.gluu.site.ldap.persistence.exception.LdapMappingException)1