From 32f084659d5f2d855c32fa55613e1bb4e431dadf Mon Sep 17 00:00:00 2001 From: Thomas Lenz Date: Mon, 30 Jun 2014 13:26:02 +0200 Subject: add checkbox to choose if all errors should be send back to online application --- .../id/configuration/data/oa/OASAML1Config.java | 21 +++++++++++++++++ .../resources/applicationResources_de.properties | 1 + .../resources/applicationResources_en.properties | 1 + .../src/main/webapp/jsp/snippets/OA/saml1.jsp | 8 +++++++ .../id/config/legacy/BuildFromLegacyConfig.java | 1 + .../moa/id/protocols/saml1/SAML1Protocol.java | 27 +++++++++++++--------- .../src/main/resources/config/moaid_config_2.0.xsd | 1 + 7 files changed, 49 insertions(+), 11 deletions(-) diff --git a/id/ConfigWebTool/src/main/java/at/gv/egovernment/moa/id/configuration/data/oa/OASAML1Config.java b/id/ConfigWebTool/src/main/java/at/gv/egovernment/moa/id/configuration/data/oa/OASAML1Config.java index 8d7d02048..7b5575a90 100644 --- a/id/ConfigWebTool/src/main/java/at/gv/egovernment/moa/id/configuration/data/oa/OASAML1Config.java +++ b/id/ConfigWebTool/src/main/java/at/gv/egovernment/moa/id/configuration/data/oa/OASAML1Config.java @@ -42,6 +42,7 @@ public class OASAML1Config implements IOnlineApplicationData{ private Boolean provideCertificate = false; private Boolean provideFullMandateData = false; private Boolean useCondition = false; + private Boolean provideAllErrors = true; private int conditionLength = -1; @@ -71,6 +72,9 @@ public class OASAML1Config implements IOnlineApplicationData{ provideIdentityLink = saml1.isProvideIdentityLink(); provideStammZahl = saml1.isProvideStammzahl(); + if (saml1.isProvideAllErrors() != null) + provideAllErrors = saml1.isProvideAllErrors(); + if (saml1.isUseCondition() != null) useCondition = saml1.isUseCondition(); @@ -122,6 +126,7 @@ public class OASAML1Config implements IOnlineApplicationData{ saml1.setProvideIdentityLink(isProvideIdentityLink()); saml1.setProvideStammzahl(isProvideStammZahl()); saml1.setUseCondition(isUseCondition()); + saml1.setProvideAllErrors(provideAllErrors); saml1.setConditionLength(BigInteger.valueOf(getConditionLength())); // TODO: set sourceID // saml1.setSourceID(""); @@ -185,5 +190,21 @@ public class OASAML1Config implements IOnlineApplicationData{ */ public void setActive(boolean isActive) { this.isActive = isActive; + } + + /** + * @return the provideAllErrors + */ + public Boolean getProvideAllErrors() { + return provideAllErrors; + } + + /** + * @param provideAllErrors the provideAllErrors to set + */ + public void setProvideAllErrors(Boolean provideAllErrors) { + this.provideAllErrors = provideAllErrors; } + + } diff --git a/id/ConfigWebTool/src/main/resources/applicationResources_de.properties b/id/ConfigWebTool/src/main/resources/applicationResources_de.properties index 5b7f2cc01..e4e7a0b63 100644 --- a/id/ConfigWebTool/src/main/resources/applicationResources_de.properties +++ b/id/ConfigWebTool/src/main/resources/applicationResources_de.properties @@ -295,6 +295,7 @@ webpages.oaconfig.saml1.provideCertificate=Zertifikat \u00FCbertragen webpages.oaconfig.saml1.provideFullMandateData=Vollst\u00E4ndige Vollmacht \u00FCbertragen webpages.oaconfig.saml1.useCondition=Usecondition webpages.oaconfig.saml1.conditionLength=ConditionLength +webpages.oaconfig.saml1.provideAllErrors=Fehlermeldungen an OA \u00FCbertragen webpages.oaconfig.protocols.pvp2.header=PVP2.x Konfiguration webpages.oaconfig.pvp2.reload=PVP2.x konfiguration neu laden diff --git a/id/ConfigWebTool/src/main/resources/applicationResources_en.properties b/id/ConfigWebTool/src/main/resources/applicationResources_en.properties index cc6e98964..dcf36103b 100644 --- a/id/ConfigWebTool/src/main/resources/applicationResources_en.properties +++ b/id/ConfigWebTool/src/main/resources/applicationResources_en.properties @@ -293,6 +293,7 @@ webpages.oaconfig.saml1.provideCertificate=Transfer certificate webpages.oaconfig.saml1.provideFullMandateData=Transfer complete mandate data webpages.oaconfig.saml1.useCondition=Use condition webpages.oaconfig.saml1.conditionLength=Condition length +webpages.oaconfig.saml1.provideAllErrors=Transfer errors to application webpages.oaconfig.protocols.pvp2.header=PVP2.x configuration webpages.oaconfig.pvp2.reload=Load new PVP2.x configuration diff --git a/id/ConfigWebTool/src/main/webapp/jsp/snippets/OA/saml1.jsp b/id/ConfigWebTool/src/main/webapp/jsp/snippets/OA/saml1.jsp index 4fd02aa61..a004a03a3 100644 --- a/id/ConfigWebTool/src/main/webapp/jsp/snippets/OA/saml1.jsp +++ b/id/ConfigWebTool/src/main/webapp/jsp/snippets/OA/saml1.jsp @@ -45,6 +45,14 @@ key="webpages.oaconfig.saml1.provideFullMandateData" cssClass="checkbox"> +
+ + + <%--


diff --git a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/config/legacy/BuildFromLegacyConfig.java b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/config/legacy/BuildFromLegacyConfig.java index 9554e3ca5..864be253a 100644 --- a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/config/legacy/BuildFromLegacyConfig.java +++ b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/config/legacy/BuildFromLegacyConfig.java @@ -453,6 +453,7 @@ public class BuildFromLegacyConfig { oa_saml1.setProvideStammzahl(oa.getProvideStammzahl()); oa_saml1.setUseCondition(oa.getUseCondition()); oa_saml1.setIsActive(true); + oa_saml1.setProvideAllErrors(false); //OA_PVP2 OAPVP2 oa_pvp2 = new OAPVP2(); diff --git a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/protocols/saml1/SAML1Protocol.java b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/protocols/saml1/SAML1Protocol.java index 399e7fa22..9c8c52e87 100644 --- a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/protocols/saml1/SAML1Protocol.java +++ b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/protocols/saml1/SAML1Protocol.java @@ -166,21 +166,26 @@ public class SAML1Protocol implements IModulInfo, MOAIDAuthConstants { IRequest protocolRequest) throws Throwable{ - SAML1AuthenticationServer saml1authentication = SAML1AuthenticationServer.getInstace(); + OAAuthParameter oa = AuthConfigurationProvider.getInstance().getOnlineApplicationParameter(protocolRequest.getOAURL()); + if (!oa.getSAML1Parameter().isProvideAllErrors()) + return false; - String samlArtifactBase64 = saml1authentication.BuildErrorAssertion(e, protocolRequest); + else { + SAML1AuthenticationServer saml1authentication = SAML1AuthenticationServer.getInstace(); + String samlArtifactBase64 = saml1authentication.BuildErrorAssertion(e, protocolRequest); - String url = AuthConfigurationProvider.getInstance().getPublicURLPrefix() + "/RedirectServlet"; - url = addURLParameter(url, RedirectServlet.REDIRCT_PARAM_URL, URLEncoder.encode(protocolRequest.getOAURL(), "UTF-8")); - url = addURLParameter(url, PARAM_SAMLARTIFACT, URLEncoder.encode(samlArtifactBase64, "UTF-8")); - url = response.encodeRedirectURL(url); + String url = AuthConfigurationProvider.getInstance().getPublicURLPrefix() + "/RedirectServlet"; + url = addURLParameter(url, RedirectServlet.REDIRCT_PARAM_URL, URLEncoder.encode(protocolRequest.getOAURL(), "UTF-8")); + url = addURLParameter(url, PARAM_SAMLARTIFACT, URLEncoder.encode(samlArtifactBase64, "UTF-8")); + url = response.encodeRedirectURL(url); - response.setContentType("text/html"); - response.setStatus(302); - response.addHeader("Location", url); - Logger.debug("REDIRECT TO: " + url); + response.setContentType("text/html"); + response.setStatus(302); + response.addHeader("Location", url); + Logger.debug("REDIRECT TO: " + url); - return true; + return true; + } } public IAction getAction(String action) { diff --git a/id/server/moa-id-commons/src/main/resources/config/moaid_config_2.0.xsd b/id/server/moa-id-commons/src/main/resources/config/moaid_config_2.0.xsd index 2d5542b98..8bc532236 100644 --- a/id/server/moa-id-commons/src/main/resources/config/moaid_config_2.0.xsd +++ b/id/server/moa-id-commons/src/main/resources/config/moaid_config_2.0.xsd @@ -859,6 +859,7 @@ + -- cgit v1.2.3