org.apache.sling.auth.core.spi
Class AbstractAuthenticationHandler
java.lang.Object
org.apache.sling.auth.core.spi.DefaultAuthenticationFeedbackHandler
org.apache.sling.auth.core.spi.AbstractAuthenticationHandler
- All Implemented Interfaces:
- AuthenticationFeedbackHandler, AuthenticationHandler
public abstract class AbstractAuthenticationHandler
- extends DefaultAuthenticationFeedbackHandler
- implements AuthenticationHandler
The AbstractAuthenticationHandler
implements the
AuthenticationHandler
interface and extends the
DefaultAuthenticationFeedbackHandler
providing some helper methods
which may be used by authentication handlers.
Method Summary |
static java.lang.String |
getAttributeOrParameter(javax.servlet.http.HttpServletRequest request,
java.lang.String name,
java.lang.String defaultValue)
Returns the value of the named request attribute or parameter as a string
as follows:
If there is a request attribute of that name, which is a non-empty
string, it is returned. |
static java.lang.String |
getLoginResource(javax.servlet.http.HttpServletRequest request,
java.lang.String defaultLoginResource)
Returns any resource target to redirect to after successful
authentication. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
AbstractAuthenticationHandler
public AbstractAuthenticationHandler()
getAttributeOrParameter
public static java.lang.String getAttributeOrParameter(javax.servlet.http.HttpServletRequest request,
java.lang.String name,
java.lang.String defaultValue)
- Returns the value of the named request attribute or parameter as a string
as follows:
- If there is a request attribute of that name, which is a non-empty
string, it is returned.
If there is a non-empty request parameter of
that name, this parameter is returned.
- Otherwise the
defaultValue
is returned.
- Parameters:
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.
- Returns:
- The attribute, parameter or
defaultValue
as defined
above.
getLoginResource
public static java.lang.String getLoginResource(javax.servlet.http.HttpServletRequest request,
java.lang.String defaultLoginResource)
- Returns any resource target to redirect to after successful
authentication. This method either returns a non-empty string or the
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.
- Parameters:
request
- The request providing the attribute or parameterdefaultLoginResource
- The default login resource value
- Returns:
- The non-empty redirection target or
defaultLoginResource
.
Copyright © 2007-2010 The Apache Software Foundation. All Rights Reserved.