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 IAuthenticationSessionStoreage |
authenticatedSessionStorage |
protected static String |
ERROR_CODE_PARAM |
protected AuthenticationSession |
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 |
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 IAuthenticationSessionStoreage authenticatedSessionStorage
@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 AuthenticationSession moasession
public abstract void execute(ExecutionContext executionContext, javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response) throws TaskExecutionException
MoaIdTaskExecutionContext executionContext as well as the
respective HttpServletRequest and HttpServletResponse.execute in class MoaIdTaskexecutionContext - The execution context (never null).request - The HttpServletRequest (never null).response - The HttpServletResponse (never null).TaskExecutionExceptionprotected 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
MoaIdTaskExecutionContext 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 MoaIdTaskpendingReq - The pending-request object (never null).executionContext - The execution context (never null).request - The HttpServletRequest (never null).response - The HttpServletResponse (never null).TaskExecutionExceptionprotected 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.MOAIDExceptionat.gv.egovernment.moa.id.commons.db.ex.MOADatabaseExceptionprotected void performRedirectToProtocolFinialization(at.gv.egovernment.moa.id.commons.api.IRequest pendingReq,
javax.servlet.http.HttpServletResponse httpResp)
pendingReq - Actually processed protocol specific authentication requesthttpResp - protected 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 characterIOExceptionCopyright © 2016. All rights reserved.