use of org.gluu.oxauth.model.configuration.CIBAEndUserNotificationConfig in project oxTrust by GluuFederation.
the class JsonConfigurationAction method getProtectedOxAuthAppConfiguration.
private String getProtectedOxAuthAppConfiguration(String oxAuthAppConfiguration) {
if (oxAuthAppConfiguration != null) {
try {
org.gluu.oxauth.model.configuration.AppConfiguration appConfiguration = jsonService.jsonToObject(oxAuthAppConfiguration, org.gluu.oxauth.model.configuration.AppConfiguration.class);
// Add missing config if needed
if (appConfiguration.getCibaEndUserNotificationConfig() == null) {
appConfiguration.setCibaEndUserNotificationConfig(new CIBAEndUserNotificationConfig());
appConfiguration.getCibaEndUserNotificationConfig().setNotificationKey("");
}
try {
String decryptedKey = encryptionService.decrypt(appConfiguration.getCibaEndUserNotificationConfig().getNotificationKey());
appConfiguration.getCibaEndUserNotificationConfig().setNotificationKey(decryptedKey);
} catch (EncryptionException ex) {
log.error("Failed to decrypt values in the oxAuth json configuration: '{}'", oxAuthAppConfiguration, ex);
appConfiguration.getCibaEndUserNotificationConfig().setNotificationKey("");
}
return jsonService.objectToJson(appConfiguration);
} catch (Exception e) {
log.error("Problems processing oxAuth App configuration file: {}", oxAuthAppConfiguration, e);
return null;
}
}
return null;
}
Aggregations