aboutsummaryrefslogtreecommitdiff
path: root/id/server/idserverlib/src/main/java/at/gv
diff options
context:
space:
mode:
authorThomas Lenz <tlenz@iaik.tugraz.at>2017-12-19 06:58:51 +0100
committerThomas Lenz <tlenz@iaik.tugraz.at>2017-12-19 06:58:51 +0100
commit5c624611466c97833c6f2f07688d7ad1232a2f45 (patch)
treefd16a32a42d0362b199dfc191c7b29dca03f3815 /id/server/idserverlib/src/main/java/at/gv
parentd45d730092daced95330c4ab2f35a1ba301ba0a7 (diff)
downloadmoa-id-spss-5c624611466c97833c6f2f07688d7ad1232a2f45.tar.gz
moa-id-spss-5c624611466c97833c6f2f07688d7ad1232a2f45.tar.bz2
moa-id-spss-5c624611466c97833c6f2f07688d7ad1232a2f45.zip
if auth. req. preprocessing failes, write transaction error into revisionsLogger
Diffstat (limited to 'id/server/idserverlib/src/main/java/at/gv')
-rw-r--r--id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/protocols/AbstractAuthProtocolModulController.java3
-rw-r--r--id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/protocols/pvp2x/PVP2XProtocol.java75
2 files changed, 70 insertions, 8 deletions
diff --git a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/protocols/AbstractAuthProtocolModulController.java b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/protocols/AbstractAuthProtocolModulController.java
index 95a7660d1..945033454 100644
--- a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/protocols/AbstractAuthProtocolModulController.java
+++ b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/protocols/AbstractAuthProtocolModulController.java
@@ -264,6 +264,9 @@ public abstract class AbstractAuthProtocolModulController extends AbstractContro
//log Error Message
statisticLogger.logErrorOperation(throwable, protocolRequest);
+ //write revision log entries
+ revisionsLogger.logEvent(protocolRequest, MOAIDEventConstants.TRANSACTION_ERROR, protocolRequest.getUniqueTransactionIdentifier());
+
return;
} else {
diff --git a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/protocols/pvp2x/PVP2XProtocol.java b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/protocols/pvp2x/PVP2XProtocol.java
index cdb85c563..4369a469a 100644
--- a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/protocols/pvp2x/PVP2XProtocol.java
+++ b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/protocols/pvp2x/PVP2XProtocol.java
@@ -172,9 +172,11 @@ public class PVP2XProtocol extends AbstractAuthProtocolModulController {
}
+ PVPTargetConfiguration pendingReq = null;
+
try {
//create pendingRequest object
- PVPTargetConfiguration pendingReq = applicationContext.getBean(PVPTargetConfiguration.class);
+ pendingReq = applicationContext.getBean(PVPTargetConfiguration.class);
pendingReq.initialize(req);
pendingReq.setModule(NAME);
@@ -198,20 +200,39 @@ public class PVP2XProtocol extends AbstractAuthProtocolModulController {
} catch (SecurityPolicyException e) {
String samlRequest = req.getParameter("SAMLRequest");
Logger.warn("Receive INVALID protocol request: " + samlRequest, e);
+
+ //write revision log entries
+ if (pendingReq != null)
+ revisionsLogger.logEvent(pendingReq, MOAIDEventConstants.TRANSACTION_ERROR, pendingReq.getUniqueTransactionIdentifier());
+
throw new InvalidProtocolRequestException("pvp2.21", new Object[] {});
} catch (SecurityException e) {
String samlRequest = req.getParameter("SAMLRequest");
Logger.warn("Receive INVALID protocol request: " + samlRequest, e);
+
+ //write revision log entries
+ if (pendingReq != null)
+ revisionsLogger.logEvent(pendingReq, MOAIDEventConstants.TRANSACTION_ERROR, pendingReq.getUniqueTransactionIdentifier());
+
throw new InvalidProtocolRequestException("pvp2.22", new Object[] {e.getMessage()});
} catch (MOAIDException e) {
+
+ //write revision log entries
+ if (pendingReq != null)
+ revisionsLogger.logEvent(pendingReq, MOAIDEventConstants.TRANSACTION_ERROR, pendingReq.getUniqueTransactionIdentifier());
+
throw e;
} catch (Throwable e) {
String samlRequest = req.getParameter("SAMLRequest");
Logger.warn("Receive INVALID protocol request: " + samlRequest, e);
-
+
+ //write revision log entries
+ if (pendingReq != null)
+ revisionsLogger.logEvent(pendingReq, MOAIDEventConstants.TRANSACTION_ERROR, pendingReq.getUniqueTransactionIdentifier());
+
throw new MOAIDException("pvp2.24", new Object[] {e.getMessage()});
}
}
@@ -224,10 +245,10 @@ public class PVP2XProtocol extends AbstractAuthProtocolModulController {
throw new ProtocolNotActiveException("auth.22", new java.lang.Object[] { NAME });
}
-
+ PVPTargetConfiguration pendingReq = null;
try {
//create pendingRequest object
- PVPTargetConfiguration pendingReq = applicationContext.getBean(PVPTargetConfiguration.class);
+ pendingReq = applicationContext.getBean(PVPTargetConfiguration.class);
pendingReq.initialize(req);
pendingReq.setModule(NAME);
@@ -251,21 +272,40 @@ public class PVP2XProtocol extends AbstractAuthProtocolModulController {
} catch (SecurityPolicyException e) {
String samlRequest = req.getParameter("SAMLRequest");
Logger.warn("Receive INVALID protocol request: " + samlRequest, e);
+
+ //write revision log entries
+ if (pendingReq != null)
+ revisionsLogger.logEvent(pendingReq, MOAIDEventConstants.TRANSACTION_ERROR, pendingReq.getUniqueTransactionIdentifier());
+
throw new InvalidProtocolRequestException("pvp2.21", new Object[] {});
} catch (SecurityException e) {
String samlRequest = req.getParameter("SAMLRequest");
Logger.warn("Receive INVALID protocol request: " + samlRequest, e);
+
+ //write revision log entries
+ if (pendingReq != null)
+ revisionsLogger.logEvent(pendingReq, MOAIDEventConstants.TRANSACTION_ERROR, pendingReq.getUniqueTransactionIdentifier());
+
throw new InvalidProtocolRequestException("pvp2.22", new Object[] {e.getMessage()});
} catch (MOAIDException e) {
String samlRequest = req.getParameter("SAMLRequest");
Logger.info("Receive INVALID protocol request: " + samlRequest);
+
+ //write revision log entries
+ if (pendingReq != null)
+ revisionsLogger.logEvent(pendingReq, MOAIDEventConstants.TRANSACTION_ERROR, pendingReq.getUniqueTransactionIdentifier());
+
throw e;
} catch (Throwable e) {
String samlRequest = req.getParameter("SAMLRequest");
Logger.warn("Receive INVALID protocol request: " + samlRequest, e);
+
+ //write revision log entries
+ if (pendingReq != null)
+ revisionsLogger.logEvent(pendingReq, MOAIDEventConstants.TRANSACTION_ERROR, pendingReq.getUniqueTransactionIdentifier());
throw new MOAIDException("pvp2.24", new Object[] {e.getMessage()});
}
@@ -280,10 +320,11 @@ public class PVP2XProtocol extends AbstractAuthProtocolModulController {
throw new ProtocolNotActiveException("auth.22", new java.lang.Object[] { NAME });
}
-
+
+ PVPTargetConfiguration pendingReq = null;
try {
//create pendingRequest object
- PVPTargetConfiguration pendingReq = applicationContext.getBean(PVPTargetConfiguration.class);
+ pendingReq = applicationContext.getBean(PVPTargetConfiguration.class);
pendingReq.initialize(req);
pendingReq.setModule(NAME);
@@ -307,20 +348,38 @@ public class PVP2XProtocol extends AbstractAuthProtocolModulController {
} catch (SecurityPolicyException e) {
String samlRequest = req.getParameter("SAMLRequest");
Logger.warn("Receive INVALID protocol request: " + samlRequest, e);
+
+ //write revision log entries
+ if (pendingReq != null)
+ revisionsLogger.logEvent(pendingReq, MOAIDEventConstants.TRANSACTION_ERROR, pendingReq.getUniqueTransactionIdentifier());
+
throw new InvalidProtocolRequestException("pvp2.21", new Object[] {});
} catch (SecurityException e) {
String samlRequest = req.getParameter("SAMLRequest");
Logger.warn("Receive INVALID protocol request: " + samlRequest, e);
+
+ //write revision log entries
+ if (pendingReq != null)
+ revisionsLogger.logEvent(pendingReq, MOAIDEventConstants.TRANSACTION_ERROR, pendingReq.getUniqueTransactionIdentifier());
+
throw new InvalidProtocolRequestException("pvp2.22", new Object[] {e.getMessage()});
- } catch (MOAIDException e) {
+ } catch (MOAIDException e) {
+ //write revision log entries
+ if (pendingReq != null)
+ revisionsLogger.logEvent(pendingReq, MOAIDEventConstants.TRANSACTION_ERROR, pendingReq.getUniqueTransactionIdentifier());
+
throw e;
} catch (Throwable e) {
String samlRequest = req.getParameter("SAMLRequest");
Logger.warn("Receive INVALID protocol request: " + samlRequest, e);
-
+
+ //write revision log entries
+ if (pendingReq != null)
+ revisionsLogger.logEvent(pendingReq, MOAIDEventConstants.TRANSACTION_ERROR, pendingReq.getUniqueTransactionIdentifier());
+
throw new MOAIDException("pvp2.24", new Object[] {e.getMessage()});
}
}