AuthenticationHandler
implementations
should extend DefaultAuthenticationFeedbackHandler
directly and use the utility methods in the AuthUtil
class.@Deprecated public abstract class AbstractAuthenticationHandler extends DefaultAuthenticationFeedbackHandler implements AuthenticationHandler
AbstractAuthenticationHandler
implements the
AuthenticationHandler
interface and extends the
DefaultAuthenticationFeedbackHandler
providing some helper methods
which may be used by authentication handlers.AuthenticationHandler.FAILURE_REASON_CODES
FAILURE_REASON, FAILURE_REASON_CODE, PATH_PROPERTY, REQUEST_LOGIN_PARAMETER, SERVICE_NAME, TYPE_PROPERTY
Constructor and Description |
---|
AbstractAuthenticationHandler()
Deprecated.
|
Modifier and Type | Method and Description |
---|---|
static String |
getAttributeOrParameter(javax.servlet.http.HttpServletRequest request,
String name,
String defaultValue)
Deprecated.
since Bundle 1.0.8, use
AuthUtil.getAttributeOrParameter(HttpServletRequest, String, String) |
static String |
getLoginResource(javax.servlet.http.HttpServletRequest request,
String defaultLoginResource)
Deprecated.
since Bundle 1.0.8, use
AuthUtil.getLoginResource(HttpServletRequest, String) |
static boolean |
isRedirectValid(javax.servlet.http.HttpServletRequest request,
String target)
Deprecated.
This method has been introduced after Bundle release 1.0.6
but has been replaced with
AuthUtil.isRedirectValid(HttpServletRequest, String) .
Use the latter method. |
static boolean |
isValidateRequest(javax.servlet.http.HttpServletRequest request)
Deprecated.
since Bundle 1.0.8, use
AuthUtil.isValidateRequest(HttpServletRequest) |
static void |
sendInvalid(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response)
Deprecated.
since Bundle 1.0.8, use
AuthUtil.sendInvalid(HttpServletRequest, HttpServletResponse) |
static void |
sendRedirect(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response,
String target,
Map<String,String> params)
Deprecated.
since Bundle 1.0.8, use
AuthUtil.sendRedirect(HttpServletRequest, HttpServletResponse, String, Map) |
static void |
sendValid(javax.servlet.http.HttpServletResponse response)
Deprecated.
since Bundle 1.0.8, use
AuthUtil.sendValid(HttpServletResponse) |
static String |
setLoginResourceAttribute(javax.servlet.http.HttpServletRequest request,
String defaultValue)
Deprecated.
since Bundle 1.0.8, use
AuthUtil.setLoginResourceAttribute(HttpServletRequest, String) |
authenticationFailed, authenticationSucceeded, handleRedirect
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
dropCredentials, extractCredentials, requestCredentials
@Deprecated public static String getAttributeOrParameter(javax.servlet.http.HttpServletRequest request, String name, String defaultValue)
AuthUtil.getAttributeOrParameter(HttpServletRequest, String, String)
defaultValue
is returned.request
- The request from which to return the attribute or request
parametername
- The name of the attribute/parameterdefaultValue
- The default value to use if neither a non-empty
string attribute or a non-empty parameter exists in the
request.defaultValue
as defined
above.@Deprecated public static String getLoginResource(javax.servlet.http.HttpServletRequest request, String defaultLoginResource)
AuthUtil.getLoginResource(HttpServletRequest, String)
defaultLoginResource
parameter. First the
resource
request attribute is checked. If it is a non-empty
string, it is returned. Second the resource
request
parameter is checked and returned if it is a non-empty string.request
- The request providing the attribute or parameterdefaultLoginResource
- The default login resource valuedefaultLoginResource
.@Deprecated public static String setLoginResourceAttribute(javax.servlet.http.HttpServletRequest request, String defaultValue)
AuthUtil.setLoginResourceAttribute(HttpServletRequest, String)
Authenticator#LOGIN_RESOURCE
request
attribute is set to a non-null, non-empty string. If the attribute is not
currently set, this method sets it as follows:
Authenticator#LOGIN_RESOURCE
request parameter is set
to a non-empty string, that parameter is setdefaultValue
is a non-empty string the
default value is usedrequest
- The request to check for the resource attributedefaultValue
- The default value to use if the attribute is not set
and the request parameter is not set. This parameter is
ignored if it is null
or an empty string.@Deprecated public static void sendRedirect(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response, String target, Map<String,String> params) throws IOException
AuthUtil.sendRedirect(HttpServletRequest, HttpServletResponse, String, Map)
This method implements the following functionality:
target
path parameter must not be prefixed with the context
path.params
map does not contain a (non-
null
) value for the resource
entry, such an entry is generated from the request URI and the
(optional) query string of the given request
.params
map or at least a single
resource
parameter are added to the
target path for the redirect. Each parameter value is encoded using the
java.net.URLEncoder
with UTF-8 encoding to make it safe for
requestsrequest
- The request object used to get the current request URI and
request query string if the params
map does not
have the resource
parameter set.response
- The response used to send the redirect to the client.target
- The target path to redirect the client to. This parameter
must not be prefixed with the request's context path because
this will be added by this method. If this parameter is not a
valid target request as per the
isRedirectValid(HttpServletRequest, String)
method
the target is modified to be the root of the request's
context.params
- The map of parameters to be added to the target path. This
may be null
.IOException
- If an error occurs sending the redirect requestIllegalStateException
- If the response was committed or if a
partial URL is given and cannot be converted into a valid URLInternalError
- If the UTF-8 character encoding is not supported by
the platform. This should not be caught, because it is a real
problem if the encoding required by the specification is
missing.AuthUtil.isRedirectValid(HttpServletRequest, String)
method.@Deprecated public static boolean isRedirectValid(javax.servlet.http.HttpServletRequest request, String target)
AuthUtil.isRedirectValid(HttpServletRequest, String)
.
Use the latter method.AuthUtil.isRedirectValid(HttpServletRequest, String)
.@Deprecated public static boolean isValidateRequest(javax.servlet.http.HttpServletRequest request)
AuthUtil.isValidateRequest(HttpServletRequest)
true
if the the client just asks for validation of
submitted username/password credentials.
This implementation returns true
if the request parameter
#PAR_J_VALIDATE
is set to true
(case-insensitve). If
the request parameter is not set or to any value other than
true
this method returns false
.
request
- The request to provide the parameter to checktrue
if the #PAR_J_VALIDATE
parameter is set
to true
.@Deprecated public static void sendValid(javax.servlet.http.HttpServletResponse response)
AuthUtil.sendValid(HttpServletResponse)
response
- The response object@Deprecated public static void sendInvalid(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)
AuthUtil.sendInvalid(HttpServletRequest, HttpServletResponse)
#X_REASON
header. The value for the
#X_REASON
header is taken from
AuthenticationHandler.FAILURE_REASON
request attribute if set.request
- The request objectresponse
- The response objectCopyright © 2014 The Apache Software Foundation. All rights reserved.