org.esupportail.cas.server.handlers.ldap
Class FastBindLdapServer

java.lang.Object
  extended by org.esupportail.cas.server.util.log.Debug
      extended by org.esupportail.cas.server.util.Server
          extended by org.esupportail.cas.server.handlers.ldap.LdapServer
              extended by org.esupportail.cas.server.handlers.ldap.FastBindLdapServer

public final class FastBindLdapServer
extends LdapServer

This class implements an LDAP server class, which can authenticate users by directly binding to an LDAP directory (fastbind method). It is used by FastBindLdapHandler.

Author:
Pascal Aubry

Field Summary
 
Fields inherited from class org.esupportail.cas.server.util.Server
AUTHENTICATE_FAILURE, AUTHENTICATE_NOAUTH, AUTHENTICATE_SUCCESS, CONNECT_FAILURE, CONNECT_NOAUTH, CONNECT_SUCCESS
 
Constructor Summary
FastBindLdapServer(java.lang.Boolean handlerDebug, RedundantHandler handler, org.dom4j.Element serverElement)
          Constructor.
 
Method Summary
 int authenticate(java.lang.String username, java.lang.String password)
          Try to authenticate a user (by binding to the LDAP directory).
 
Methods inherited from class org.esupportail.cas.server.handlers.ldap.LdapServer
connect, connectAndClose, replaceTokens
 
Methods inherited from class org.esupportail.cas.server.util.Server
getConnectError, getHandler, getServerSubElementContent, setConnectError
 
Methods inherited from class org.esupportail.cas.server.util.log.Debug
checkClass, elementDebugValue, isDebug, setDebug, trace, trace, traceBegin, traceEnd, traceEnd, traceEnd, traceThrow
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FastBindLdapServer

public FastBindLdapServer(java.lang.Boolean handlerDebug,
                          RedundantHandler handler,
                          org.dom4j.Element serverElement)
                   throws java.lang.Exception
Constructor.

Parameters:
handlerDebug - debugging mode of the handler
handler - the handler the server will be used by
serverElement - the XML element that declares the server
Throws:
java.lang.Exception - Exception
Method Detail

authenticate

public int authenticate(java.lang.String username,
                        java.lang.String password)
Try to authenticate a user (by binding to the LDAP directory).

Specified by:
authenticate in class Server
Parameters:
username - the user's name
password - the user's password
Returns:
Server.AUTHENTICATE_SUCCESS, Server.AUTHENTICATE_NOAUTH or Server.AUTHENTICATE_FAILURE.