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
TheAbstractAuthenticationHandlerHolderis 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 protectedAbstractAuthenticationHandlerHolder(String fullPath, org.osgi.framework.ServiceReference serviceReference)
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected abstract voiddoDropCredentials(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)Calls the actual authentication handler to request the credentials from the client.protected abstract AuthenticationInfodoExtractCredentials(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)Calls the actual authentication handler to extract the credentials from the request.protected abstract booleandoRequestCredentials(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)Calls the actual authentication handler to request the credentials from the client.voiddropCredentials(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)Sets theAuthenticationHandler.PATH_PROPERTYrequest attribute to thisPathBasedHolder.fullPathand calls thedoDropCredentials(HttpServletRequest, HttpServletResponse)to have the credentials dropped by the held authentication handler.AuthenticationInfoextractCredentials(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)Sets theAuthenticationHandler.PATH_PROPERTYrequest attribute to thisPathBasedHolder.fullPathand calls theextractCredentials(HttpServletRequest, HttpServletResponse)to have the credentials extracted from the request.protected abstract AuthenticationFeedbackHandlergetFeedbackHandler()Returns a feedback handler provided by the authentication handler held by this instance ornullif none is provided.booleanrequestCredentials(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)Sets theAuthenticationHandler.PATH_PROPERTYrequest attribute to thisPathBasedHolder.fullPathand 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_PROPERTYrequest attribute to thisPathBasedHolder.fullPathand calls theextractCredentials(HttpServletRequest, HttpServletResponse)to have the credentials extracted from the request.- Specified by:
extractCredentialsin 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 IOExceptionSets theAuthenticationHandler.PATH_PROPERTYrequest attribute to thisPathBasedHolder.fullPathand calls thedoRequestCredentials(HttpServletRequest, HttpServletResponse)to have the credentials requested from the client.- Specified by:
requestCredentialsin 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 IOExceptionSets theAuthenticationHandler.PATH_PROPERTYrequest attribute to thisPathBasedHolder.fullPathand calls thedoDropCredentials(HttpServletRequest, HttpServletResponse)to have the credentials dropped by the held authentication handler.- Specified by:
dropCredentialsin 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 ornullif 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 IOExceptionCalls 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 IOExceptionCalls 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)
-
-