summaryrefslogtreecommitdiff
path: root/eaaf_core/src/main/java/at/gv/egiz/eaaf/core/impl/idp/auth/services/ProtocolAuthenticationService.java
diff options
context:
space:
mode:
Diffstat (limited to 'eaaf_core/src/main/java/at/gv/egiz/eaaf/core/impl/idp/auth/services/ProtocolAuthenticationService.java')
-rw-r--r--eaaf_core/src/main/java/at/gv/egiz/eaaf/core/impl/idp/auth/services/ProtocolAuthenticationService.java17
1 files changed, 12 insertions, 5 deletions
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 d915910b..9627e01a 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
@@ -80,6 +80,8 @@ import at.gv.egiz.eaaf.core.impl.utils.KeyValueUtils;
import at.gv.egiz.eaaf.core.impl.utils.ServletUtils;
+import static at.gv.egiz.eaaf.core.api.IStatusMessenger.CODES_INTERNAL_ERROR_GENERIC;
+
@Service
public class ProtocolAuthenticationService implements IProtocolAuthenticationService {
private static final Logger log = LoggerFactory.getLogger(ProtocolAuthenticationService.class);
@@ -263,11 +265,10 @@ public class ProtocolAuthenticationService implements IProtocolAuthenticationSer
}
- } catch (final Throwable e) {
+ } catch (final Throwable e) { //
handleErrorNoRedirect(throwable, req, resp, true);
}
-
}
@Override
@@ -284,8 +285,14 @@ public class ProtocolAuthenticationService implements IProtocolAuthenticationSer
// write errror to console
logExceptionToTechnicalLog(errorData);
- // return error to Web browser
- displayException(req, resp, errorData);
+ if (errorData.getActionType().equals(ErrorTicketService.ActionType.NOTICKET_NOREDIRECT) ||
+ errorData.getActionType().equals(ErrorTicketService.ActionType.TICKET_NOREDIRECT)) {
+ // return error to Web browser
+ displayException(req, resp, errorData);
+ } else {
+ throw new EaafException(IStatusMessenger.CODES_INTERNAL_ERROR_GENERIC, null,
+ new Exception("On Erroraction mapping mismatch", throwable));
+ }
}
@Override
@@ -519,7 +526,7 @@ public class ProtocolAuthenticationService implements IProtocolAuthenticationSer
} else {
// write generic message for general exceptions
- final String msg = statusMessager.getMessage(IStatusMessenger.CODES_INTERNAL_ERROR_GENERIC, null);
+ final String msg = statusMessager.getMessage(CODES_INTERNAL_ERROR_GENERIC, null);
writeHtmlErrorResponse(req, resp, msg, internalErrorCode, null,
statusMessager.mapInternalErrorToExternalError(internalErrorCode), errorData.getRedirectUrl(),
errorData.getSupportTicket());