Package org.apache.sling.auth.core.impl
Class AbstractAuthenticationHandlerHolder
- java.lang.Object
-
- org.apache.sling.auth.core.impl.PathBasedHolder
-
- org.apache.sling.auth.core.impl.AbstractAuthenticationHandlerHolder
-
- All Implemented Interfaces:
Comparable<PathBasedHolder>
,AuthenticationHandler
- Direct Known Subclasses:
EngineAuthenticationHandlerHolder
public abstract class AbstractAuthenticationHandlerHolder extends PathBasedHolder implements AuthenticationHandler
TheAbstractAuthenticationHandlerHolder
is a base class to represent authentication handlers (both legacy and new ones) for use in theSlingAuthenticator
.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface org.apache.sling.auth.core.spi.AuthenticationHandler
AuthenticationHandler.FAILURE_REASON_CODES
-
-
Field Summary
-
Fields inherited from class org.apache.sling.auth.core.impl.PathBasedHolder
fullPath
-
Fields inherited from interface org.apache.sling.auth.core.spi.AuthenticationHandler
FAILURE_REASON, FAILURE_REASON_CODE, PATH_PROPERTY, REQUEST_LOGIN_PARAMETER, SERVICE_NAME, TYPE_PROPERTY
-
-
Constructor Summary
Constructors Modifier Constructor Description protected
AbstractAuthenticationHandlerHolder(String fullPath, org.osgi.framework.ServiceReference serviceReference)
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected abstract void
doDropCredentials(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)
Calls the actual authentication handler to request the credentials from the client.protected abstract AuthenticationInfo
doExtractCredentials(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)
Calls the actual authentication handler to extract the credentials from the request.protected abstract boolean
doRequestCredentials(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)
Calls the actual authentication handler to request the credentials from the client.void
dropCredentials(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)
Sets theAuthenticationHandler.PATH_PROPERTY
request attribute to thisPathBasedHolder.fullPath
and calls thedoDropCredentials(HttpServletRequest, HttpServletResponse)
to have the credentials dropped by the held authentication handler.AuthenticationInfo
extractCredentials(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)
Sets theAuthenticationHandler.PATH_PROPERTY
request attribute to thisPathBasedHolder.fullPath
and calls theextractCredentials(HttpServletRequest, HttpServletResponse)
to have the credentials extracted from the request.protected abstract AuthenticationFeedbackHandler
getFeedbackHandler()
Returns a feedback handler provided by the authentication handler held by this instance ornull
if none is provided.boolean
requestCredentials(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)
Sets theAuthenticationHandler.PATH_PROPERTY
request attribute to thisPathBasedHolder.fullPath
and calls thedoRequestCredentials(HttpServletRequest, HttpServletResponse)
to have the credentials requested from the client.-
Methods inherited from class org.apache.sling.auth.core.impl.PathBasedHolder
compareTo, equals, hashCode
-
-
-
-
Constructor Detail
-
AbstractAuthenticationHandlerHolder
protected AbstractAuthenticationHandlerHolder(String fullPath, org.osgi.framework.ServiceReference serviceReference)
-
-
Method Detail
-
extractCredentials
public final AuthenticationInfo extractCredentials(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)
Sets theAuthenticationHandler.PATH_PROPERTY
request attribute to thisPathBasedHolder.fullPath
and calls theextractCredentials(HttpServletRequest, HttpServletResponse)
to have the credentials extracted from the request.- Specified by:
extractCredentials
in interfaceAuthenticationHandler
- Parameters:
request
- the current requestresponse
- the current response- Returns:
- the result of calling
doExtractCredentials(HttpServletRequest, HttpServletResponse)
-
requestCredentials
public final boolean requestCredentials(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response) throws IOException
Sets theAuthenticationHandler.PATH_PROPERTY
request attribute to thisPathBasedHolder.fullPath
and calls thedoRequestCredentials(HttpServletRequest, HttpServletResponse)
to have the credentials requested from the client.- Specified by:
requestCredentials
in interfaceAuthenticationHandler
- Parameters:
request
- the current requestresponse
- the current response- Returns:
- the result of calling
doRequestCredentials(HttpServletRequest, HttpServletResponse)
- Throws:
IOException
- if an error occurs interacting with the client
-
dropCredentials
public final void dropCredentials(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response) throws IOException
Sets theAuthenticationHandler.PATH_PROPERTY
request attribute to thisPathBasedHolder.fullPath
and calls thedoDropCredentials(HttpServletRequest, HttpServletResponse)
to have the credentials dropped by the held authentication handler.- Specified by:
dropCredentials
in interfaceAuthenticationHandler
- Parameters:
request
- the current requestresponse
- the current response- Throws:
IOException
- if an error occurs interacting with the client
-
getFeedbackHandler
protected abstract AuthenticationFeedbackHandler getFeedbackHandler()
Returns a feedback handler provided by the authentication handler held by this instance ornull
if none is provided.
-
doExtractCredentials
protected abstract AuthenticationInfo doExtractCredentials(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)
Calls the actual authentication handler to extract the credentials from the request.- Parameters:
request
- The current requestresponse
- The current response- Returns:
- as returned from the called authentication handler
- See Also:
extractCredentials(HttpServletRequest, HttpServletResponse)
-
doRequestCredentials
protected abstract boolean doRequestCredentials(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response) throws IOException
Calls the actual authentication handler to request the credentials from the client.- Parameters:
request
- The current requestresponse
- The current response- Returns:
- as returned from the called authentication handler
- Throws:
IOException
- if an error occurs sending back any response to the client.- See Also:
requestCredentials(HttpServletRequest, HttpServletResponse)
-
doDropCredentials
protected abstract void doDropCredentials(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response) throws IOException
Calls the actual authentication handler to request the credentials from the client.- Parameters:
request
- The current requestresponse
- The current response- Throws:
IOException
- if an error occurs sending back any response to the client.- See Also:
dropCredentials(HttpServletRequest, HttpServletResponse)
-
-