diff options
Diffstat (limited to 'eaaf_core/src/main/java/at/gv/egiz/eaaf/core/impl/idp/auth/services')
2 files changed, 17 insertions, 6 deletions
diff --git a/eaaf_core/src/main/java/at/gv/egiz/eaaf/core/impl/idp/auth/services/DefaultErrorService.java b/eaaf_core/src/main/java/at/gv/egiz/eaaf/core/impl/idp/auth/services/DefaultErrorService.java index e8be535c..e41905a6 100644 --- a/eaaf_core/src/main/java/at/gv/egiz/eaaf/core/impl/idp/auth/services/DefaultErrorService.java +++ b/eaaf_core/src/main/java/at/gv/egiz/eaaf/core/impl/idp/auth/services/DefaultErrorService.java @@ -20,7 +20,7 @@ import lombok.extern.slf4j.Slf4j; @Slf4j public class DefaultErrorService implements IErrorService { - private static final String TECH_LOG_MSG = "errorCode={} Message={}"; + private static final String TECH_LOG_MSG = "errorCode={0} Message={1}"; private static final String CONFIG_PROP_LOGGER_ON_INFO_LEVEL = "core.logging.level.info.errorcodes"; @Autowired IConfiguration basicConfig; diff --git a/eaaf_core/src/main/java/at/gv/egiz/eaaf/core/impl/idp/auth/services/ProtocolAuthenticationService.java b/eaaf_core/src/main/java/at/gv/egiz/eaaf/core/impl/idp/auth/services/ProtocolAuthenticationService.java index 4b2cbd0e..635cfa0e 100644 --- a/eaaf_core/src/main/java/at/gv/egiz/eaaf/core/impl/idp/auth/services/ProtocolAuthenticationService.java +++ b/eaaf_core/src/main/java/at/gv/egiz/eaaf/core/impl/idp/auth/services/ProtocolAuthenticationService.java @@ -242,10 +242,21 @@ public class ProtocolAuthenticationService implements IProtocolAuthenticationSer protocolRequest.getUniqueTransactionIdentifier()); if (ActionType.TICKET.equals(errorData.getActionType())) { - // Put pending request - final ExceptionContainer exceptionContainer = new ExceptionContainer(protocolRequest, throwable); - final byte[] serialized = SerializationUtils.serialize(exceptionContainer); - transactionStorage.put(errorData.getErrorIdTokenForRedirect(), serialized, -1); + + if (errorData.getErrorIdTokenForRedirect() != null) { + // Put pending request + final ExceptionContainer exceptionContainer = new ExceptionContainer(protocolRequest, throwable); + final byte[] serialized = SerializationUtils.serialize(exceptionContainer); + log.debug("Put error into cache to support SP forwarding ... "); + String internalErrorToken = pendingReqIdGenerationStrategy.getPendingRequestIdWithOutChecks( + errorData.getErrorIdTokenForRedirect()); + log.trace("errorIdToken: {}", internalErrorToken); + transactionStorage.put(internalErrorToken, serialized, -1); + + } else { + log.debug("No errorTokenId. Forwarding to SP will not be available"); + + } // render GUI displayException(req, resp, errorData); @@ -299,7 +310,7 @@ public class ProtocolAuthenticationService implements IProtocolAuthenticationSer final HttpServletResponse resp, final boolean writeExceptionToStatisticLog) throws EaafException, IOException { - final IErrorService.IHandleData errorData = errorTicketService.createHandleData(throwable, true); + final IErrorService.IHandleData errorData = errorTicketService.createHandleData(throwable, false); // log Exception into statistic database if (writeExceptionToStatisticLog) { |