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));
}
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;
}
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);
}
}
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);
}
}
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");
}
}
Aggregations