aboutsummaryrefslogtreecommitdiff
path: root/id/oa/src/main/java/at/gv/egovernment/moa/id/demoOA/servlet/pvp2/DemoApplication.java
diff options
context:
space:
mode:
Diffstat (limited to 'id/oa/src/main/java/at/gv/egovernment/moa/id/demoOA/servlet/pvp2/DemoApplication.java')
-rw-r--r--id/oa/src/main/java/at/gv/egovernment/moa/id/demoOA/servlet/pvp2/DemoApplication.java37
1 files changed, 29 insertions, 8 deletions
diff --git a/id/oa/src/main/java/at/gv/egovernment/moa/id/demoOA/servlet/pvp2/DemoApplication.java b/id/oa/src/main/java/at/gv/egovernment/moa/id/demoOA/servlet/pvp2/DemoApplication.java
index 2d32ce9af..0b30d7d86 100644
--- a/id/oa/src/main/java/at/gv/egovernment/moa/id/demoOA/servlet/pvp2/DemoApplication.java
+++ b/id/oa/src/main/java/at/gv/egovernment/moa/id/demoOA/servlet/pvp2/DemoApplication.java
@@ -1,3 +1,25 @@
+/*******************************************************************************
+ * Copyright 2014 Federal Chancellery Austria
+ * MOA-ID has been developed in a cooperation between BRZ, the Federal
+ * Chancellery Austria - ICT staff unit, and Graz University of Technology.
+ *
+ * Licensed under the EUPL, Version 1.1 or - as soon they will be approved by
+ * the European Commission - subsequent versions of the EUPL (the "Licence");
+ * You may not use this work except in compliance with the Licence.
+ * You may obtain a copy of the Licence at:
+ * http://www.osor.eu/eupl/
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the Licence is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the Licence for the specific language governing permissions and
+ * limitations under the Licence.
+ *
+ * This product combines work with different licenses. See the "NOTICE" text
+ * file for details on the various modules and licenses.
+ * The "NOTICE" text file is part of the distribution. Any derivative works
+ * that you distribute must include a readable copy of the "NOTICE" text file.
+ *******************************************************************************/
package at.gv.egovernment.moa.id.demoOA.servlet.pvp2;
import java.io.IOException;
@@ -11,7 +33,6 @@ import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;
-import org.apache.log4j.Logger;
import org.opensaml.common.SAMLObject;
import org.opensaml.common.binding.BasicSAMLMessageContext;
import org.opensaml.common.xml.SAMLConstants;
@@ -53,13 +74,13 @@ import at.gv.egovernment.moa.id.demoOA.Configuration;
import at.gv.egovernment.moa.id.demoOA.PVPConstants;
import at.gv.egovernment.moa.id.demoOA.utils.ApplicationBean;
import at.gv.egovernment.moa.id.demoOA.utils.SAML2Utils;
+import at.gv.egovernment.moa.logging.Logger;
import at.gv.egovernment.moa.util.DOMUtils;
public class DemoApplication extends HttpServlet {
private static final long serialVersionUID = -2129228304760706063L;
- private static final Logger log = Logger.getLogger(DemoApplication.class);
@@ -73,7 +94,7 @@ public class DemoApplication extends HttpServlet {
String method = request.getMethod();
HttpSession session = request.getSession();
if (session == null) {
- log.info("NO HTTP Session");
+ Logger.info("NO HTTP Session");
bean.setErrorMessage("NO HTTP session");
setAnser(request, response, bean);
return;
@@ -96,7 +117,7 @@ public class DemoApplication extends HttpServlet {
Signature sign = samlResponse.getSignature();
if (sign == null) {
- log.info("Only http POST Requests can be used");
+ Logger.info("Only http POST Requests can be used");
bean.setErrorMessage("Only http POST Requests can be used");
setAnser(request, response, bean);
return;
@@ -126,7 +147,7 @@ public class DemoApplication extends HttpServlet {
ExplicitKeySignatureTrustEngine trustEngine = new ExplicitKeySignatureTrustEngine(credentialResolver, keyInfoResolver);
trustEngine.validate(sign, criteriaSet);
- log.info("PVP2 Assertion is valid");
+ Logger.info("PVP2 Assertion is valid");
if (samlResponse.getStatus().getStatusCode().getValue().equals(StatusCode.SUCCESS_URI)) {
@@ -137,7 +158,7 @@ public class DemoApplication extends HttpServlet {
if (encryAssertionList != null && encryAssertionList.size() > 0) {
//decrypt assertions
- log.debug("Found encryped assertion. Start decryption ...");
+ Logger.debug("Found encryped assertion. Start decryption ...");
KeyStore keyStore = config.getPVP2KeyStore();
@@ -163,7 +184,7 @@ public class DemoApplication extends HttpServlet {
}
- log.debug("Assertion decryption finished. ");
+ Logger.debug("Assertion decryption finished. ");
} else {
saml2assertions = samlResponse.getAssertions();
@@ -219,7 +240,7 @@ public class DemoApplication extends HttpServlet {
}
} catch (Exception e) {
- log.warn(e);
+ Logger.warn(e);
bean.setErrorMessage("Internal Error: " + e.getMessage());
setAnser(request, response, bean);
return;