public abstract class AbstractAuthServletTask extends MoaIdTask
AuthServlet
, providing the same utility methods (error handling, parameter parsing
etc.). The code has been taken from AuthServlet
.Modifier and Type | Field and Description |
---|---|
protected at.gv.egovernment.moa.id.commons.api.AuthConfiguration |
authConfig |
protected static String |
ERROR_CODE_PARAM |
protected at.gv.egovernment.moa.id.commons.api.data.IAuthenticationSession |
moasession |
protected at.gv.egovernment.moa.id.commons.api.IRequest |
pendingReq |
protected IRequestStorage |
requestStoreage |
protected MOAReversionLogger |
revisionsLogger |
Constructor and Description |
---|
AbstractAuthServletTask() |
Modifier and Type | Method and Description |
---|---|
protected static String |
addURLParameter(String url,
String paramname,
String paramvalue)
Adds a parameter to a URL.
|
protected void |
defaultTaskInitialization(javax.servlet.http.HttpServletRequest req,
ExecutionContext executionContext)
Default initialization loads the MOASession object from database
|
abstract void |
execute(ExecutionContext executionContext,
javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response)
Executes the task providing the underlying
ExecutionContext executionContext as well as the
respective HttpServletRequest and HttpServletResponse . |
protected Map<String,String> |
getParameters(javax.servlet.http.HttpServletRequest req)
Parses the request input stream for parameters, assuming parameters are
encoded UTF-8 (no standard exists how browsers should encode them).
|
protected at.gv.egovernment.moa.id.commons.api.IRequest |
internalExecute(at.gv.egovernment.moa.id.commons.api.IRequest pendingReq,
ExecutionContext executionContext,
javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response)
Executes the task providing the underlying
ExecutionContext executionContext
and the IRequest pendingReq as well as the
respective HttpServletRequest and HttpServletResponse . |
protected void |
performRedirectToItself(at.gv.egovernment.moa.id.commons.api.IRequest pendingReq,
javax.servlet.http.HttpServletResponse httpResp,
String moaIDEndPoint)
Redirect the authentication process to MOA-ID-Auth itself
|
protected void |
performRedirectToProtocolFinialization(at.gv.egovernment.moa.id.commons.api.IRequest pendingReq,
javax.servlet.http.HttpServletResponse httpResp)
Redirect the authentication process to protocol specific finalization endpoint.
|
protected String |
readBytesUpTo(InputStream in,
char delimiter)
Reads bytes up to a delimiter, consuming the delimiter.
|
@Autowired protected IRequestStorage requestStoreage
@Autowired protected MOAReversionLogger revisionsLogger
@Autowired protected at.gv.egovernment.moa.id.commons.api.AuthConfiguration authConfig
protected static final String ERROR_CODE_PARAM
protected at.gv.egovernment.moa.id.commons.api.IRequest pendingReq
protected at.gv.egovernment.moa.id.commons.api.data.IAuthenticationSession moasession
public abstract void execute(ExecutionContext executionContext, javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response) throws TaskExecutionException
MoaIdTask
ExecutionContext
executionContext
as well as the
respective HttpServletRequest
and HttpServletResponse
.execute
in class MoaIdTask
executionContext
- The execution context (never null
).request
- The HttpServletRequest (never null
).response
- The HttpServletResponse (never null
).TaskExecutionException
protected final at.gv.egovernment.moa.id.commons.api.IRequest internalExecute(at.gv.egovernment.moa.id.commons.api.IRequest pendingReq, ExecutionContext executionContext, javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response) throws TaskExecutionException
MoaIdTask
ExecutionContext
executionContext
and the IRequest
pendingReq
as well as the
respective HttpServletRequest
and HttpServletResponse
.
This method sets the pending-request object of the task implementation and starts the
execute
method of the taskinternalExecute
in class MoaIdTask
pendingReq
- The pending-request object (never null
).executionContext
- The execution context (never null
).request
- The HttpServletRequest (never null
).response
- The HttpServletResponse (never null
).TaskExecutionException
protected void defaultTaskInitialization(javax.servlet.http.HttpServletRequest req, ExecutionContext executionContext) throws at.gv.egovernment.moa.id.commons.api.exceptions.MOAIDException, at.gv.egovernment.moa.id.commons.db.ex.MOADatabaseException
req
- executionContext
- at.gv.egovernment.moa.id.commons.api.exceptions.MOAIDException
at.gv.egovernment.moa.id.commons.db.ex.MOADatabaseException
protected void performRedirectToProtocolFinialization(at.gv.egovernment.moa.id.commons.api.IRequest pendingReq, javax.servlet.http.HttpServletResponse httpResp)
pendingReq
- Actually processed protocol specific authentication requesthttpResp
- protected void performRedirectToItself(at.gv.egovernment.moa.id.commons.api.IRequest pendingReq, javax.servlet.http.HttpServletResponse httpResp, String moaIDEndPoint)
pendingReq
- Actually processed protocol specific authentication requesthttpResp
- moaIDEndPoint
- Servlet EndPoint that should receive the redirectprotected Map<String,String> getParameters(javax.servlet.http.HttpServletRequest req) throws IOException, org.apache.commons.fileupload.FileUploadException
req
- servlet requestIOException
- if parsing request parameters fails.org.apache.commons.fileupload.FileUploadException
- if parsing request parameters fails.protected String readBytesUpTo(InputStream in, char delimiter) throws IOException
in
- input streamdelimiter
- delimiter characterIOException
Copyright © 2017. All rights reserved.