summaryrefslogtreecommitdiff
path: root/eaaf_core/src/main/java/at/gv
diff options
context:
space:
mode:
authorThomas <thomas.lenz@egiz.gv.at>2019-10-16 21:07:46 +0200
committerThomas <thomas.lenz@egiz.gv.at>2019-10-16 21:07:46 +0200
commit984da0a51743f2a8159548d5b626353022868677 (patch)
tree40481262ed60dc73f891c49c0c4795c04bc70442 /eaaf_core/src/main/java/at/gv
parent77d1fee107c2673c85e0fdba93cdb0cfe27b5f4f (diff)
downloadEAAF-Components-984da0a51743f2a8159548d5b626353022868677.tar.gz
EAAF-Components-984da0a51743f2a8159548d5b626353022868677.tar.bz2
EAAF-Components-984da0a51743f2a8159548d5b626353022868677.zip
move common method into abstract class
Diffstat (limited to 'eaaf_core/src/main/java/at/gv')
-rw-r--r--eaaf_core/src/main/java/at/gv/egiz/eaaf/core/impl/idp/controller/tasks/AbstractLocaleAuthServletTask.java15
1 files changed, 13 insertions, 2 deletions
diff --git a/eaaf_core/src/main/java/at/gv/egiz/eaaf/core/impl/idp/controller/tasks/AbstractLocaleAuthServletTask.java b/eaaf_core/src/main/java/at/gv/egiz/eaaf/core/impl/idp/controller/tasks/AbstractLocaleAuthServletTask.java
index e8f2bb90..84290ad0 100644
--- a/eaaf_core/src/main/java/at/gv/egiz/eaaf/core/impl/idp/controller/tasks/AbstractLocaleAuthServletTask.java
+++ b/eaaf_core/src/main/java/at/gv/egiz/eaaf/core/impl/idp/controller/tasks/AbstractLocaleAuthServletTask.java
@@ -39,8 +39,7 @@ public abstract class AbstractLocaleAuthServletTask extends AbstractAuthServletT
log.trace("Find {} parameter. Processing this task ... ",PROP_REQ_PARAM_LOCALE);
executionContext.remove(EAAFConstants.PROCESSCONTEXT_SWITCH_LANGUAGE);
- final String stopAuthFlag = request.getParameter(EAAFConstants.PARAM_HTTP_STOP_PROCESS);
- if (StringUtils.isNotEmpty(stopAuthFlag) && Boolean.parseBoolean(stopAuthFlag)) {
+ if (parseFlagFromHttpRequest(request, EAAFConstants.PARAM_HTTP_STOP_PROCESS, false)) {
log.info("Authentication process WAS stopped by entity. Stopping auth. process ... ");
stopProcessFromUserDecision(executionContext, request, response);
@@ -69,6 +68,18 @@ public abstract class AbstractLocaleAuthServletTask extends AbstractAuthServletT
}
+ protected boolean parseFlagFromHttpRequest(HttpServletRequest httpReq, String httpParamName, boolean defaultValue) {
+ String flag = httpReq.getParameter(httpParamName);
+ log.trace("Get httpParam: {} with value: {}", httpParamName, flag);
+ if (StringUtils.isNotEmpty(httpParamName)) {
+ return Boolean.parseBoolean(flag);
+
+ } else {
+ return defaultValue;
+ }
+
+ }
+
protected abstract void executeWithLocale(ExecutionContext executionContext, HttpServletRequest request,
HttpServletResponse response) throws TaskExecutionException;