Applications use this class by overriding {@link #getPasswordAuthentication()} in a sub-class. This method willtypically use the various getXXX() accessor methods to get information about the entity requesting authentication. It must then acquire a username and password either by interacting with the user or through some other non-interactive means. The credentials are then returned as a {@link PasswordAuthentication} return value.
An instance of this concrete sub-class is then registered with the system by calling {@link #setDefault(Authenticator)}. When authentication is required, the system will invoke one of the requestPasswordAuthentication() methods which in turn will call the getPasswordAuthentication() method of the registered object.
All methods that request authentication have a default implementation that fails. @see java.net.Authenticator#setDefault(java.net.Authenticator) @see java.net.Authenticator#getPasswordAuthentication() @author Bill Foote @version 1.33, 11/17/05 @since 1.2
{@link Authenticator}s are registered to and configured by {@link AuthenticationInterceptor} interceptor.
{@link AuthenticationInterceptor} authenticates users by calling{@link #authenticate(DN,ServerContext)}, and then {@link Authenticator}checks JNDI {@link Context} environment properties( {@link Context#SECURITY_PRINCIPAL} and {@link Context#SECURITY_CREDENTIALS}) of current {@link Context}. @see AbstractAuthenticator @author Apache Directory Project @version $Rev: 918766 $
Authenticator ::= [APPLICATION 2] SEQUENCE { authenticator-vno [0] INTEGER (5), crealm [1] Realm, cname [2]@author Apache Directory Project, cksum [3] OPTIONAL, cusec [4] Microseconds, ctime [5] KerberosTime, subkey [6] OPTIONAL, seq-number [7] UInt32 OPTIONAL, authorization-data [8] OPTIONAL }
Likewise implementing a logout script (ESP, too) is equally simple:
if (request.authType) { // not logged in at all, no need to logout } else { var auth = sling.getService(org.apache.sling.commons.auth.Authenticator); if (auth != null) { auth.logout(request, response); } else { // handle the case of no Authenticator service to logout with } }
This interface is not intended to be implemented by applications but may be used to initiate the authentication process form a request processing servlet or script. @since 1.0 (Sling API Bundle 2.1.0)
Authenticator
interface defines the service interface of the authenticator used by the Sling engine. This service provides a method to find an {@link AuthenticationHandler} and call its{@link AuthenticationHandler#requestAuthentication(HttpServletRequest,HttpServletResponse)}method. This interface is not intended to be implemented by applications but may be used to initiate the authentication process form a request processing servlet or script. @since 2.0.4 This is version of the sling engine module where these classes wherehosted before. @deprecated use {@link org.apache.sling.auth.core.AuthenticationSupport} instead
An Authenticator is responsible for checking requests and sending response challenges in order to authenticate a request. Various types of {@link Authentication} are returned in order tosignal the next step in authentication. @version $Rev: 4793 $ $Date: 2009-03-19 00:00:01 +0100 (Thu, 19 Mar 2009) $
Authenticator
authenticates new connections
@author Tim Anderson
@version $Revision: 1.1 $ $Date: 2004/11/26 01:51:03 $
@see ManagedConnectionAcceptor
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|