summaryrefslogtreecommitdiff
path: root/eaaf_core/src/main/java/at/gv/egiz/eaaf/core/impl/idp/auth/modules/AbstractAuthServletTask.java
diff options
context:
space:
mode:
Diffstat (limited to 'eaaf_core/src/main/java/at/gv/egiz/eaaf/core/impl/idp/auth/modules/AbstractAuthServletTask.java')
-rw-r--r--eaaf_core/src/main/java/at/gv/egiz/eaaf/core/impl/idp/auth/modules/AbstractAuthServletTask.java67
1 files changed, 35 insertions, 32 deletions
diff --git a/eaaf_core/src/main/java/at/gv/egiz/eaaf/core/impl/idp/auth/modules/AbstractAuthServletTask.java b/eaaf_core/src/main/java/at/gv/egiz/eaaf/core/impl/idp/auth/modules/AbstractAuthServletTask.java
index c785e1cb..3d093a9f 100644
--- a/eaaf_core/src/main/java/at/gv/egiz/eaaf/core/impl/idp/auth/modules/AbstractAuthServletTask.java
+++ b/eaaf_core/src/main/java/at/gv/egiz/eaaf/core/impl/idp/auth/modules/AbstractAuthServletTask.java
@@ -27,11 +27,24 @@ import java.util.Iterator;
import java.util.List;
import java.util.Map;
import java.util.Map.Entry;
+
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
+
+import org.apache.commons.fileupload.FileItem;
+import org.apache.commons.fileupload.FileItemFactory;
+import org.apache.commons.fileupload.FileUploadException;
+import org.apache.commons.fileupload.disk.DiskFileItemFactory;
+import org.apache.commons.fileupload.servlet.ServletFileUpload;
+import org.apache.commons.lang3.ArrayUtils;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.core.io.ResourceLoader;
+
import at.gv.egiz.eaaf.core.api.IRequest;
import at.gv.egiz.eaaf.core.api.IRequestStorage;
-import at.gv.egiz.eaaf.core.api.data.EAAFConstants;
+import at.gv.egiz.eaaf.core.api.data.EaafConstants;
import at.gv.egiz.eaaf.core.api.idp.IConfiguration;
import at.gv.egiz.eaaf.core.api.idp.auth.services.IProtocolAuthenticationService;
import at.gv.egiz.eaaf.core.api.idp.process.ExecutionContext;
@@ -41,20 +54,10 @@ import at.gv.egiz.eaaf.core.exceptions.TaskExecutionException;
import at.gv.egiz.eaaf.core.impl.idp.controller.ProtocolFinalizationController;
import at.gv.egiz.eaaf.core.impl.idp.process.springweb.AbstractTask;
import at.gv.egiz.eaaf.core.impl.utils.DataUrlBuilder;
-import org.apache.commons.fileupload.FileItem;
-import org.apache.commons.fileupload.FileItemFactory;
-import org.apache.commons.fileupload.FileUploadException;
-import org.apache.commons.fileupload.disk.DiskFileItemFactory;
-import org.apache.commons.fileupload.servlet.ServletFileUpload;
-import org.apache.commons.lang3.ArrayUtils;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.core.io.ResourceLoader;
/**
- * Task based counterpart to {@link AuthServlet}, providing the same utility methods (error
- * handling, parameter parsing etc.).
+ * Task based counterpart to {@link AuthServlet}, providing the same utility
+ * methods (error handling, parameter parsing etc.).
* </p>
* The code has been taken from {@link AuthServlet}.
*/
@@ -81,7 +84,6 @@ public abstract class AbstractAuthServletTask extends AbstractTask {
public abstract void execute(ExecutionContext executionContext, HttpServletRequest request,
HttpServletResponse response) throws TaskExecutionException;
-
@Override
protected final IRequest internalExecute(final IRequest pendingReq,
final ExecutionContext executionContext, final HttpServletRequest request,
@@ -90,7 +92,7 @@ public abstract class AbstractAuthServletTask extends AbstractTask {
this.pendingReq = pendingReq;
// add latest pendingRequestId on execution context
- executionContext.put(EAAFConstants.PROCESS_ENGINE_PENDINGREQUESTID,
+ executionContext.put(EaafConstants.PROCESS_ENGINE_PENDINGREQUESTID,
pendingReq.getPendingRequestId());
// execute task specific action
@@ -101,20 +103,22 @@ public abstract class AbstractAuthServletTask extends AbstractTask {
}
/**
- * Redirect the authentication process to protocol specific finalization endpoint.
+ * Redirect the authentication process to protocol specific finalization
+ * endpoint.
*
* @param executionContext
*
- * @param pendingReq Actually processed protocol specific authentication request
- * @param httpResp http response object
- * @throws IOException In case of a general error
+ * @param pendingReq Actually processed protocol specific authentication
+ * request
+ * @param httpResp http response object
+ * @throws IOException In case of a general error
* @throws EaafException In case of an application error
*/
protected void performRedirectToProtocolFinialization(final ExecutionContext executionContext,
final IRequest pendingReq, final HttpServletRequest httpReq,
final HttpServletResponse httpResp) throws EaafException, IOException {
final Object frontChannelRedirectFlagObj =
- executionContext.get(EAAFConstants.PROCESS_ENGINE_REQUIRES_NO_POSTAUTH_REDIRECT);
+ executionContext.get(EaafConstants.PROCESS_ENGINE_REQUIRES_NO_POSTAUTH_REDIRECT);
if (frontChannelRedirectFlagObj != null && frontChannelRedirectFlagObj instanceof Boolean
&& (Boolean) frontChannelRedirectFlagObj) {
log.info("AuthProcess finished. Forward to Protocol finalization.");
@@ -128,15 +132,14 @@ public abstract class AbstractAuthServletTask extends AbstractTask {
}
-
-
}
/**
* Redirect the authentication process to IDP itself.
*
- * @param pendingReq Actually processed protocol specific authentication request
- * @param httpResp http response
+ * @param pendingReq Actually processed protocol specific authentication
+ * request
+ * @param httpResp http response
* @param idpEndPoint Servlet EndPoint that should receive the redirect
*/
protected void performRedirectToItself(final IRequest pendingReq,
@@ -151,16 +154,15 @@ public abstract class AbstractAuthServletTask extends AbstractTask {
}
-
/**
- * Parses the request input stream for parameters, assuming parameters are encoded UTF-8 (no
- * standard exists how browsers should encode them).
+ * Parses the request input stream for parameters, assuming parameters are
+ * encoded UTF-8 (no standard exists how browsers should encode them).
*
* @param req servlet request
*
* @return mapping parameter name -> value
*
- * @throws IOException if parsing request parameters fails.
+ * @throws IOException if parsing request parameters fails.
*
* @throws FileUploadException if parsing request parameters fails.
*/
@@ -215,7 +217,8 @@ public abstract class AbstractAuthServletTask extends AbstractTask {
final Entry<String, String[]> entry = requestParamIt.next();
final String key = entry.getKey();
final String[] values = entry.getValue();
- // take the last value from the value array since the legacy code above also does it this
+ // take the last value from the value array since the legacy code above also
+ // does it this
// way
parameters.put(key, ArrayUtils.isEmpty(values) ? null : values[values.length - 1]);
}
@@ -228,7 +231,7 @@ public abstract class AbstractAuthServletTask extends AbstractTask {
/**
* Reads bytes up to a delimiter, consuming the delimiter.
*
- * @param in input stream
+ * @param in input stream
* @param delimiter delimiter character
* @return String constructed from the read bytes
* @throws IOException In case of a general error
@@ -251,8 +254,8 @@ public abstract class AbstractAuthServletTask extends AbstractTask {
/**
* Adds a parameter to a URL.
*
- * @param url the URL
- * @param paramname parameter name
+ * @param url the URL
+ * @param paramname parameter name
* @param paramvalue parameter value
* @return the URL with parameter added
*/