@Service(value={org.apache.sling.api.auth.Authenticator.class,AuthenticationSupport.class,javax.servlet.ServletRequestListener.class})
@Property(name="osgi.http.whiteboard.context.select",value="(osgi.http.whiteboard.context.name=*)") @Property(name="osgi.http.whiteboard.listener",value="true") @Property(name="service.vendor",value="The Apache Software Foundation")
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 | Field and Description |
|---|---|
static String |
PAR_ANONYMOUS_ALLOWED |
static String |
PAR_AUTH_URI_SUFFIX
The name of the configuration property used to set a (potentially
empty) list of request URI suffixes intended to be handled by
authentication handlers.
|
static String |
PAR_IMPERSONATION_COOKIE_NAME |
static String |
PAR_IMPERSONATION_PAR_NAME |
static String |
PAR_REALM_NAME
The name of the configuration property used to set the Realm of the
built-in HTTP Basic authentication handler.
|
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) |
@Property(value="sling.sudo") public static final String PAR_IMPERSONATION_COOKIE_NAME
@Property(value="sudo") public static final String PAR_IMPERSONATION_PAR_NAME
@Property(boolValue=true) public static final String PAR_ANONYMOUS_ALLOWED
@Property(value="Sling (Development)") public static final String PAR_REALM_NAME
@Property(value="/j_security_check",
unbounded=ARRAY)
public static final String PAR_AUTH_URI_SUFFIX
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–2017 The Apache Software Foundation. All rights reserved.