public class SlingAuthenticator extends Object implements org.apache.sling.api.auth.Authenticator, AuthenticationSupport, javax.servlet.ServletRequestListener
SlingAuthenticator class is the default implementation for
handling authentication. This class supports :
AuthenticationHandler interface.
Currently this class does not support multiple handlers for any one request URL.
| Modifier and Type | Class and Description |
|---|---|
static interface |
SlingAuthenticator.Config |
LOGIN_RESOURCE, SERVICE_NAMEREDIRECT_PARAMETER, REQUEST_ATTRIBUTE_RESOLVER, SERVICE_NAME| Constructor and Description |
|---|
SlingAuthenticator() |
| Modifier and Type | Method and Description |
|---|---|
boolean |
handleSecurity(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response)
Checks the authentication contained in the request.
|
void |
login(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response)
Requests authentication information from the client.
|
void |
logout(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response)
Logs out the user calling all applicable
AuthenticationHandler
authentication handlers. |
void |
requestDestroyed(javax.servlet.ServletRequestEvent sre) |
void |
requestInitialized(javax.servlet.ServletRequestEvent sre) |
public boolean handleSecurity(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response)
handleSecurity in interface AuthenticationSupportrequest - The request object containing the information for the
authentication.response - The response object which may be used to send the
information on the request failure to the user.true if request processing should continue assuming
successful authentication. If false is returned it
is assumed a response has been sent to the client and the request
is terminated.public void login(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response)
true if the information has been requested and request
processing can be terminated. Otherwise the request information could not
be requested and the request should be terminated with a 403/FORBIDDEN
response.
Any response sent by the handler is also handled by the error handler infrastructure.
login in interface org.apache.sling.api.auth.Authenticatorrequest - The request objectresponse - The response object to which to send the requestIllegalStateException - If response is already committedorg.apache.sling.api.auth.NoAuthenticationHandlerException - If no authentication handler
claims responsibility to authenticate the request.public void logout(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response)
AuthenticationHandler
authentication handlers.logout in interface org.apache.sling.api.auth.Authenticatorpublic void requestInitialized(javax.servlet.ServletRequestEvent sre)
requestInitialized in interface javax.servlet.ServletRequestListenerpublic void requestDestroyed(javax.servlet.ServletRequestEvent sre)
requestDestroyed in interface javax.servlet.ServletRequestListenerCopyright © 2007–2020 The Apache Software Foundation. All rights reserved.