Search in sources :

Example 1 with AppConfiguration

use of org.xdi.oxauth.model.configuration.AppConfiguration in project oxAuth by GluuFederation.

the class ConfigurationTest method loadConfFromFile.

private static AppConfiguration loadConfFromFile(String p_filePath) throws JAXBException {
    final JAXBContext jc = JAXBContext.newInstance(AppConfiguration.class);
    final Unmarshaller u = jc.createUnmarshaller();
    return (AppConfiguration) u.unmarshal(new File(p_filePath));
}
Also used : AppConfiguration(org.xdi.oxauth.model.configuration.AppConfiguration) JAXBContext(javax.xml.bind.JAXBContext) Unmarshaller(javax.xml.bind.Unmarshaller) File(java.io.File)

Example 2 with AppConfiguration

use of org.xdi.oxauth.model.configuration.AppConfiguration in project oxAuth by GluuFederation.

the class ConfigurationFactory method reloadConfFromFile.

private boolean reloadConfFromFile() {
    final AppConfiguration configFromFile = loadConfFromFile();
    if (configFromFile != null) {
        log.info("Reloaded configuration from file: " + configFilePath);
        conf = configFromFile;
        return true;
    } else {
        log.error("Failed to load configuration from file: " + configFilePath);
    }
    return false;
}
Also used : AppConfiguration(org.xdi.oxauth.model.configuration.AppConfiguration)

Example 3 with AppConfiguration

use of org.xdi.oxauth.model.configuration.AppConfiguration in project oxAuth by GluuFederation.

the class CryptoProviderTest method configuration.

@Test
public void configuration() {
    try {
        AppConfiguration appConfiguration = configurationFactory.getAppConfiguration();
        assertNotNull(appConfiguration);
        cryptoProvider = CryptoProviderFactory.getCryptoProvider(appConfiguration);
        assertNotNull(cryptoProvider);
        GregorianCalendar calendar = new GregorianCalendar(TimeZone.getTimeZone("UTC"));
        calendar.add(GregorianCalendar.MINUTE, 5);
        expirationTime = calendar.getTimeInMillis();
    } catch (Exception e) {
        fail(e.getMessage(), e);
    }
}
Also used : AppConfiguration(org.xdi.oxauth.model.configuration.AppConfiguration) GregorianCalendar(java.util.GregorianCalendar) Test(org.testng.annotations.Test) ConfigurableTest(org.xdi.oxauth.ConfigurableTest)

Example 4 with AppConfiguration

use of org.xdi.oxauth.model.configuration.AppConfiguration in project oxAuth by GluuFederation.

the class CorsFilter method init.

@Override
public void init(FilterConfig filterConfig) throws ServletException {
    AppConfiguration appConfiguration = configurationFactory.getAppConfiguration();
    this.filter = getServerCorsFilter();
    if (this.filter != null) {
        String filterName = filterConfig.getFilterName();
        CorsFilterConfig corsFilterConfig = new CorsFilterConfig(filterName, appConfiguration);
        filter.init(corsFilterConfig);
    }
}
Also used : AppConfiguration(org.xdi.oxauth.model.configuration.AppConfiguration)

Example 5 with AppConfiguration

use of org.xdi.oxauth.model.configuration.AppConfiguration in project oxTrust by GluuFederation.

the class ConfigureLogViewerAction method updateOxAuthConfiguration.

private void updateOxAuthConfiguration() {
    try {
        AppConfiguration appConfiguration = jsonConfigurationService.getOxauthAppConfiguration();
        appConfiguration.setExternalLoggerConfiguration(oxAuthLogConfigLocation);
        jsonConfigurationService.saveOxAuthAppConfiguration(appConfiguration);
    } catch (IOException e) {
        log.error("Failed to update oxauth-config.json", e);
        facesMessages.add(FacesMessage.SEVERITY_ERROR, "Failed to update oxAuth configuration in LDAP");
    }
}
Also used : AppConfiguration(org.xdi.oxauth.model.configuration.AppConfiguration) IOException(java.io.IOException)

Aggregations

AppConfiguration (org.xdi.oxauth.model.configuration.AppConfiguration)5 File (java.io.File)1 IOException (java.io.IOException)1 GregorianCalendar (java.util.GregorianCalendar)1 JAXBContext (javax.xml.bind.JAXBContext)1 Unmarshaller (javax.xml.bind.Unmarshaller)1 Test (org.testng.annotations.Test)1 ConfigurableTest (org.xdi.oxauth.ConfigurableTest)1