summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorlalber <lukas.alber@iaik.tugraz.at>2021-03-26 08:48:10 +0100
committerlalber <lukas.alber@iaik.tugraz.at>2021-03-26 08:48:10 +0100
commitf76af302b54a0ddc0668ae93a2d32a07b60e6495 (patch)
tree65ecf083d21fc25a22d832566d56a19a8691a921
parentbf258e421c55baf64eb9bb30b95e4d29bfdef5eb (diff)
downloadEAAF-Components-f76af302b54a0ddc0668ae93a2d32a07b60e6495.tar.gz
EAAF-Components-f76af302b54a0ddc0668ae93a2d32a07b60e6495.tar.bz2
EAAF-Components-f76af302b54a0ddc0668ae93a2d32a07b60e6495.zip
better error conf and some fixes
-rw-r--r--eaaf_core/src/main/java/at/gv/egiz/eaaf/core/impl/idp/auth/services/ErrorTicketService.java11
-rw-r--r--eaaf_core/src/main/java/at/gv/egiz/eaaf/core/impl/idp/auth/services/ProtocolAuthenticationService.java17
2 files changed, 17 insertions, 11 deletions
diff --git a/eaaf_core/src/main/java/at/gv/egiz/eaaf/core/impl/idp/auth/services/ErrorTicketService.java b/eaaf_core/src/main/java/at/gv/egiz/eaaf/core/impl/idp/auth/services/ErrorTicketService.java
index 8bcb5305..08fb04c6 100644
--- a/eaaf_core/src/main/java/at/gv/egiz/eaaf/core/impl/idp/auth/services/ErrorTicketService.java
+++ b/eaaf_core/src/main/java/at/gv/egiz/eaaf/core/impl/idp/auth/services/ErrorTicketService.java
@@ -39,7 +39,8 @@ public class ErrorTicketService {
public enum ActionType {
TICKET_REDIRECT("ticket_redirect"), TICKET_NOREDIRECT("ticket_noredirect"), NOTICKET_REDIRECT(
- "noticket_redirect"), NOTICKET_NOREDIRECT("noticket_noredirect");
+ "noticket_redirect"), NOTICKET_NOREDIRECT("noticket_noredirect"), NOTICKET_AUTOREDIRECT(
+ "noticket_autoredirect");
private final String name;
@@ -67,7 +68,7 @@ public class ErrorTicketService {
if (StringUtils.isEmpty(ticketConfPath)) {
- log.error("Error: Path to errorhandling action configuration not known");
+ log.error("Error: Path to errorhandling-action mapping not known");
throw new EaafException("internal.configuration.00",
new Object[]{CONFIG_PROP_ERRORHANDLING_ACTION_PATH});
} else {
@@ -90,7 +91,8 @@ public class ErrorTicketService {
} catch (Exception e) {
log.error("Error: could not found file.", e);
throw new EaafException("internal.configuration.01",
- new Object[]{CONFIG_PROP_ERRORHANDLING_ACTION_PATH, "File cloud not be found."});
+ new Object[]{CONFIG_PROP_ERRORHANDLING_ACTION_PATH, "File for errorhandling-action mapping cloud "
+ + "not be found."});
}
}
}
@@ -148,6 +150,9 @@ public class ErrorTicketService {
data.actionType = ActionType.NOTICKET_REDIRECT;
data.generateRedirect();
+ } else if (action.equals(ActionType.NOTICKET_AUTOREDIRECT.toString())) {
+ data.actionType = ActionType.NOTICKET_AUTOREDIRECT;
+
} else { // ActionType.NOTICKET_NOREDIRECT -> nothing to be done
data.actionType = ActionType.NOTICKET_NOREDIRECT;
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 d078d085..09977f52 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
@@ -234,7 +234,8 @@ public class ProtocolAuthenticationService implements IProtocolAuthenticationSer
try {
ErrorTicketService.HandleData errorData = errorTicketService.createHandleData(throwable, req);
- if (errorData.getActionType().equals(ErrorTicketService.ActionType.TICKET_REDIRECT)) {
+ if (errorData.getActionType().equals(ErrorTicketService.ActionType.TICKET_REDIRECT)
+ || errorData.getActionType().equals(ErrorTicketService.ActionType.NOTICKET_REDIRECT)) {
// Put pending request
ExceptionContainer exceptionContainer = new ExceptionContainer(protocolRequest, throwable);
@@ -253,7 +254,7 @@ public class ProtocolAuthenticationService implements IProtocolAuthenticationSer
displayException(req, resp, errorData);
- } else if (errorData.getActionType().equals(ErrorTicketService.ActionType.NOTICKET_REDIRECT)) {
+ } else if (errorData.getActionType().equals(ErrorTicketService.ActionType.NOTICKET_AUTOREDIRECT)) {
IModulInfo handlingModule = extractShibbolethHandling(protocolRequest, applicationContext);
if (handlingModule.generateErrorMessage(throwable, req, resp, protocolRequest)) {
@@ -278,7 +279,7 @@ public class ProtocolAuthenticationService implements IProtocolAuthenticationSer
}
- } catch (final Throwable e) { //
+ } catch (final Throwable e) {
// if building error response results in error, we try with with handleErrorNoRedirect
handleErrorNoRedirect(e, req, resp, true);
@@ -287,18 +288,18 @@ public class ProtocolAuthenticationService implements IProtocolAuthenticationSer
/**
* Retrieves shibboleth module info.
- * @param protocolRequest current request
+ *
+ * @param protocolRequest current request
* @param applicationContext spring context
* @return IModulInfo
* @throws ClassNotFoundException If no shibboleth handling implementation found
*/
- public static IModulInfo extractShibbolethHandling(IRequest protocolRequest,
- ApplicationContext applicationContext) throws ClassNotFoundException {
+ public static IModulInfo extractShibbolethHandling(IRequest protocolRequest, ApplicationContext applicationContext)
+ throws ClassNotFoundException {
final Class<?> clazz = Class.forName(protocolRequest.requestedModule());
if (clazz == null || !IModulInfo.class.isAssignableFrom(clazz)) {
- log.error(
- "Requested protocol module Class is NULL or does not implement the IModulInfo interface.");
+ log.error("Requested protocol module Class is NULL or does not implement the IModulInfo interface.");
throw new ClassCastException(
"Requested protocol module Class is NULL or does not implement the IModulInfo interface.");