public class MultiMechsAuthenticationHandler extends Object implements AuthenticationHandler
Modifier and Type | Class and Description |
---|---|
static class |
MultiMechsAuthenticationHandler.AuthHandlerEnum |
Constructor and Description |
---|
MultiMechsAuthenticationHandler() |
Modifier and Type | Method and Description |
---|---|
protected void |
addHeader(javax.servlet.http.HttpServletResponse response)
Children must override this method with supplying corresponding header
|
AuthenticationToken |
authenticate(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response)
Authenticate main method:
In step 1.
|
void |
destroy()
Destroys the authentication handler instance.
|
protected MultiMechsAuthenticationHandler |
getAuthBasedEntity(String authorization)
Children must override this method to essentially return "this" based on the request header
or null if request header is not suitable to a given auth mechanism
|
String |
getType()
Returns the authentication type of the authentication handler.
|
void |
init(Properties config)
Initializes the authentication handler instance.
|
boolean |
managementOperation(AuthenticationToken token,
javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response)
Returns true by default.
|
protected AuthenticationToken |
postauthenticate(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response)
Children must override this method to perform real authentication based on the information received
in the request header
|
public void init(Properties config) throws javax.servlet.ServletException
AuthenticationHandler
AuthenticationFilter.init(javax.servlet.FilterConfig)
method.init
in interface AuthenticationHandler
config
- configuration properties to initialize the handler.javax.servlet.ServletException
- thrown if the handler could not be initialized.public AuthenticationToken authenticate(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response) throws IOException, AuthenticationException
authenticate
in interface AuthenticationHandler
request
- the HTTP client request.response
- the HTTP client response.AuthenticationToken
if the HTTP client request has been authenticated,
null
otherwise (in this case it must take care of the response).IOException
- thrown if an IO error occurred.AuthenticationException
- thrown if an Authentication error occurred.protected void addHeader(javax.servlet.http.HttpServletResponse response)
response
- protected AuthenticationToken postauthenticate(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response) throws IOException, AuthenticationException
request
- response
- IOException
AuthenticationException
public void destroy()
AuthenticationHandler
AuthenticationFilter.destroy()
method.destroy
in interface AuthenticationHandler
protected MultiMechsAuthenticationHandler getAuthBasedEntity(String authorization)
authorization
- public String getType()
AuthenticationHandler
getType
in interface AuthenticationHandler
public boolean managementOperation(AuthenticationToken token, javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response) throws IOException, AuthenticationException
managementOperation
in interface AuthenticationHandler
token
- the authentication token if any, otherwise NULL
.request
- the HTTP client request.response
- the HTTP client response.TRUE
if the request should be processed as a regular
request,
FALSE
otherwise.IOException
- thrown if an IO error occurred.AuthenticationException
- thrown if an Authentication error occurred.Copyright © 2014 Apache Software Foundation. All Rights Reserved.