org.apache.ldap.server.authn
Class AbstractAuthenticator

java.lang.Object
  extended byorg.apache.ldap.server.authn.AbstractAuthenticator
All Implemented Interfaces:
Authenticator, AuthenticatorConfig
Direct Known Subclasses:
AnonymousAuthenticator, SimpleAuthenticator

public abstract class AbstractAuthenticator
extends java.lang.Object
implements Authenticator, AuthenticatorConfig

Base class for all Authenticators.

Author:
Apache Directory Project

Field Summary
 AuthenticatorConfig authenticatorConfig
          authenticator config
 java.lang.String authenticatorType
          authenticator type
 
Constructor Summary
AbstractAuthenticator(java.lang.String type)
          Create a new AuthenticationService.
 
Method Summary
abstract  LdapPrincipal authenticate(ServerContext ctx)
          Perform the authentication operation and return the authorization id if successfull.
protected  LdapPrincipal createLdapPrincipal(java.lang.String dn)
          Allows a means to create an LDAP principal without exposing LdapPrincipal creation to the rest of the world.
 AuthenticatorConfig getAuthenticatorConfig()
          Return this authenticator's AuthenticatorConfig object.
 AuthenticatorContext getAuthenticatorContext()
          Returns a reference to the AuthenticatorContext in which this authenticator is running.
 java.lang.String getAuthenticatorName()
          Returns the name of this authenticator instance.
 java.lang.String getAuthenticatorType()
          Returns this authenticator's type.
 java.lang.String getInitParameter(java.lang.String name)
          Returns a String containing the value of the named initialization parameter, or null if the parameter does not exist.
 java.util.Enumeration getInitParameterNames()
          Returns the names of the servlet's initialization parameters as an Enumeration of String objects, or an empty Enumeration if the servlet has no initialization parameters.
 void init()
          A convenience method which can be overridden so that there's no need to call super.init( authenticatorConfig ).
 void init(AuthenticatorConfig authenticatorConfig)
          Called by the server to indicate to an authenticator that the authenticator is being placed into service.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

authenticatorConfig

public AuthenticatorConfig authenticatorConfig
authenticator config


authenticatorType

public java.lang.String authenticatorType
authenticator type

Constructor Detail

AbstractAuthenticator

public AbstractAuthenticator(java.lang.String type)
Create a new AuthenticationService.

Parameters:
type - authenticator's type
Method Detail

getAuthenticatorContext

public AuthenticatorContext getAuthenticatorContext()
Returns a reference to the AuthenticatorContext in which this authenticator is running.

Specified by:
getAuthenticatorContext in interface AuthenticatorConfig

getAuthenticatorType

public java.lang.String getAuthenticatorType()
Returns this authenticator's type.

Specified by:
getAuthenticatorType in interface Authenticator

getAuthenticatorConfig

public AuthenticatorConfig getAuthenticatorConfig()
Return this authenticator's AuthenticatorConfig object.

Specified by:
getAuthenticatorConfig in interface Authenticator

init

public void init(AuthenticatorConfig authenticatorConfig)
          throws javax.naming.NamingException
Called by the server to indicate to an authenticator that the authenticator is being placed into service.

Specified by:
init in interface Authenticator
Parameters:
authenticatorConfig -
Throws:
javax.naming.NamingException

init

public void init()
          throws javax.naming.NamingException
A convenience method which can be overridden so that there's no need to call super.init( authenticatorConfig ).

Throws:
javax.naming.NamingException

authenticate

public abstract LdapPrincipal authenticate(ServerContext ctx)
                                    throws javax.naming.NamingException
Perform the authentication operation and return the authorization id if successfull.

Specified by:
authenticate in interface Authenticator
Parameters:
ctx -
Returns:
the authorization id
Throws:
javax.naming.NamingException

getAuthenticatorName

public java.lang.String getAuthenticatorName()
Returns the name of this authenticator instance.

Specified by:
getAuthenticatorName in interface AuthenticatorConfig

getInitParameter

public java.lang.String getInitParameter(java.lang.String name)
Returns a String containing the value of the named initialization parameter, or null if the parameter does not exist.

Specified by:
getInitParameter in interface AuthenticatorConfig

getInitParameterNames

public java.util.Enumeration getInitParameterNames()
Returns the names of the servlet's initialization parameters as an Enumeration of String objects, or an empty Enumeration if the servlet has no initialization parameters.

Specified by:
getInitParameterNames in interface AuthenticatorConfig

createLdapPrincipal

protected LdapPrincipal createLdapPrincipal(java.lang.String dn)
                                     throws javax.naming.NamingException
Allows a means to create an LDAP principal without exposing LdapPrincipal creation to the rest of the world.

Parameters:
dn - the distinguished name of the X.500 principal
Returns:
the principal for the dn
Throws:
javax.naming.NamingException - if there is a problem parsing the dn


Copyright © 2002-2005 . All Rights Reserved.