diff options
Diffstat (limited to 'id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/config/ConfigurationMigrationUtils.java')
-rw-r--r-- | id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/config/ConfigurationMigrationUtils.java | 54 |
1 files changed, 35 insertions, 19 deletions
diff --git a/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/config/ConfigurationMigrationUtils.java b/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/config/ConfigurationMigrationUtils.java index 5233aa5d8..05de581d2 100644 --- a/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/config/ConfigurationMigrationUtils.java +++ b/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/config/ConfigurationMigrationUtils.java @@ -591,33 +591,44 @@ public class ConfigurationMigrationUtils { templates.getAditionalAuthBlockText()); TransformsInfoType bkuSelectTemplate = templates.getBKUSelectionTemplate(); - if (bkuSelectTemplate != null && MiscUtil.isNotEmpty(bkuSelectTemplate.getFilename())) { - try { - result.put(MOAIDConfigurationConstants.SERVICE_AUTH_TEMPLATES_BKUSELECTION_DATA, - Base64Utils.encode(bkuSelectTemplate.getTransformation())); - result.put(MOAIDConfigurationConstants.SERVICE_AUTH_TEMPLATES_BKUSELECTION_PREVIEW, - bkuSelectTemplate.getFilename()); + if (bkuSelectTemplate != null ) { + if (bkuSelectTemplate.isDelete()) + result.put(MOAIDConfigurationConstants.SERVICE_AUTH_TEMPLATES_BKUSELECTION_DELETE, Boolean.TRUE.toString()); - } catch (Exception e) { - Logger.warn("BKU selection templated can not converted.", e); + if (MiscUtil.isNotEmpty(bkuSelectTemplate.getFilename())) { + try { + result.put(MOAIDConfigurationConstants.SERVICE_AUTH_TEMPLATES_BKUSELECTION_DATA, + new String(bkuSelectTemplate.getTransformation())); + result.put(MOAIDConfigurationConstants.SERVICE_AUTH_TEMPLATES_BKUSELECTION_PREVIEW, + bkuSelectTemplate.getFilename()); + } catch (Exception e) { + Logger.warn("BKU selection templated can not converted.", e); + + } } } TransformsInfoType sendAssertionTemplate = templates.getSendAssertionTemplate(); - if (sendAssertionTemplate != null && MiscUtil.isNotEmpty(sendAssertionTemplate.getFilename())) { - try { - result.put(MOAIDConfigurationConstants.SERVICE_AUTH_TEMPLATES_SENDASSERTION_DATA, - Base64Utils.encode(sendAssertionTemplate.getTransformation())); - result.put(MOAIDConfigurationConstants.SERVICE_AUTH_TEMPLATES_SENDASSERTION_PREVIEW, - sendAssertionTemplate.getFilename()); + if (sendAssertionTemplate != null ) { + + if (sendAssertionTemplate.isDelete()) + result.put(MOAIDConfigurationConstants.SERVICE_AUTH_TEMPLATES_SENDASSERTION_DELETE, Boolean.TRUE.toString()); + + if (MiscUtil.isNotEmpty(sendAssertionTemplate.getFilename())) { + try { + result.put(MOAIDConfigurationConstants.SERVICE_AUTH_TEMPLATES_SENDASSERTION_DATA, + new String(sendAssertionTemplate.getTransformation())); + result.put(MOAIDConfigurationConstants.SERVICE_AUTH_TEMPLATES_SENDASSERTION_PREVIEW, + sendAssertionTemplate.getFilename()); - } catch (Exception e) { - Logger.warn("Send assertion templated can not converted.", e); + } catch (Exception e) { + Logger.warn("Send assertion templated can not converted.", e); - } + } + } } BKUSelectionCustomizationType formcustom = templates.getBKUSelectionCustomization(); @@ -1443,8 +1454,13 @@ public class ConfigurationMigrationUtils { dbauthgeneral.setTimeOuts(dbtimeouts); } - dbtimeouts.setAssertion(new BigInteger(moaconfig.get(MOAIDConfigurationConstants.GENERAL_AUTH_TIMEOUTS_TRANSACTION))); - dbtimeouts.setMOASessionCreated(new BigInteger(moaconfig.get(MOAIDConfigurationConstants.GENERAL_AUTH_TIMEOUS_SSO_CREATE))); + if (MiscUtil.isNotEmpty(moaconfig.get(MOAIDConfigurationConstants.GENERAL_AUTH_TIMEOUTS_TRANSACTION))) + dbtimeouts.setAssertion(new BigInteger(moaconfig.get(MOAIDConfigurationConstants.GENERAL_AUTH_TIMEOUTS_TRANSACTION))); + + if (MiscUtil.isNotEmpty(moaconfig.get(MOAIDConfigurationConstants.GENERAL_AUTH_TIMEOUS_SSO_CREATE))) + dbtimeouts.setMOASessionCreated(new BigInteger(moaconfig.get(MOAIDConfigurationConstants.GENERAL_AUTH_TIMEOUS_SSO_CREATE))); + + if (MiscUtil.isNotEmpty(moaconfig.get(MOAIDConfigurationConstants.GENERAL_AUTH_TIMEOUS_SSO_UPDATE))) dbtimeouts.setMOASessionUpdated(new BigInteger(moaconfig.get(MOAIDConfigurationConstants.GENERAL_AUTH_TIMEOUS_SSO_UPDATE))); Protocols dbprotocols = dbauth.getProtocols(); |