org.aselect.authspserver.authsp.ldap
Class AbstractLDAPProtocolHandler

java.lang.Object
  extended by org.aselect.authspserver.authsp.ldap.AbstractLDAPProtocolHandler
All Implemented Interfaces:
ILDAPProtocolHandler
Direct Known Subclasses:
LDAPSimpleProtocolHandler, LDAPSSLProtocolHandler

public abstract class AbstractLDAPProtocolHandler
extends java.lang.Object
implements ILDAPProtocolHandler

This class contains base functionality for LDAP AuthSP handlers.

Description:
Contains base configuration and initialisation functionality.

Concurrency issues:
-

Author:
Alfa & Ariss

Field Summary
protected  boolean _bFullUid
          The complete user ID.
protected  java.lang.String _sBaseDn
          The base DN.
protected  java.lang.String _sDriver
          The JNDI driver.
protected  java.lang.String _sLDAPUrl
          The LDAP URL.
protected  java.lang.String _sModule
          The module name
protected  java.lang.String _sPrincipalDn
          The princial DN
protected  java.lang.String _sPrincipalPwd
          The principal password.
protected  java.lang.String _sUid
          The user ID.
protected  java.lang.String _sUserDn
          The user DN.
protected  AuthSPSystemLogger _systemLogger
          The logger that logs system information
 
Constructor Summary
AbstractLDAPProtocolHandler()
           
 
Method Summary
 java.lang.String authenticate(java.lang.String sPassword)
          Authenticate a user using LDAP.
protected abstract  void doBind(java.lang.String sPassword)
          Bind to the LDAP server using the user credentials.
 boolean init(java.lang.String sLDAPUrl, java.lang.String sDriver, java.lang.String sBaseDn, java.lang.String sUserDn, boolean bFullUid, java.lang.String sUid, java.lang.String sPrincipalDn, java.lang.String sPrincipalPwd, AuthSPSystemLogger systemLogger)
          Set the configuration items and the system logger.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

_sModule

protected java.lang.String _sModule
The module name


_sLDAPUrl

protected java.lang.String _sLDAPUrl
The LDAP URL.


_sDriver

protected java.lang.String _sDriver
The JNDI driver.


_sBaseDn

protected java.lang.String _sBaseDn
The base DN.


_sUserDn

protected java.lang.String _sUserDn
The user DN.


_sUid

protected java.lang.String _sUid
The user ID.


_sPrincipalDn

protected java.lang.String _sPrincipalDn
The princial DN


_sPrincipalPwd

protected java.lang.String _sPrincipalPwd
The principal password.


_bFullUid

protected boolean _bFullUid
The complete user ID.


_systemLogger

protected AuthSPSystemLogger _systemLogger
The logger that logs system information

Constructor Detail

AbstractLDAPProtocolHandler

public AbstractLDAPProtocolHandler()
Method Detail

init

public boolean init(java.lang.String sLDAPUrl,
                    java.lang.String sDriver,
                    java.lang.String sBaseDn,
                    java.lang.String sUserDn,
                    boolean bFullUid,
                    java.lang.String sUid,
                    java.lang.String sPrincipalDn,
                    java.lang.String sPrincipalPwd,
                    AuthSPSystemLogger systemLogger)
Set the configuration items and the system logger.

Specified by:
init in interface ILDAPProtocolHandler
Parameters:
sLDAPUrl - The URl to the LDAP back-end.
sDriver - The JNDI driver.
sBaseDn - The Base DN.
sUserDn - The user DN.
bFullUid - True if the full uid must be sent to the backend
sUid - The LDAP user name.
sPrincipalDn - the principal DN.
sPrincipalPwd - The principal password.
systemLogger - The logger for system entries.
Returns:
true if initialisation is successfull, otherwise false.
See Also:
ILDAPProtocolHandler.init(java.lang.String, java.lang.String, java.lang.String, java.lang.String, boolean, java.lang.String, java.lang.String, java.lang.String, org.aselect.authspserver.log.AuthSPSystemLogger)

authenticate

public java.lang.String authenticate(java.lang.String sPassword)
Authenticate a user using LDAP.

Specified by:
authenticate in interface ILDAPProtocolHandler
Parameters:
sPassword - the password to validate.
Returns:
The authentication result code (as specified in Errors).
See Also:
ILDAPProtocolHandler.authenticate( java.lang.String)

doBind

protected abstract void doBind(java.lang.String sPassword)
                        throws ASelectException
Bind to the LDAP server using the user credentials.

Parameters:
sPassword - The user password.
Throws:
ASelectException - If user could not be authenticated.


Copyright © 2008 SURFnet BV. All Rights Reserved.