blackboard.platform.security.authentication
Class LDAPAuthModule

java.lang.Object
  extended by blackboard.platform.security.authentication.BaseAuthenticationModule
      extended by blackboard.platform.security.authentication.LDAPAuthModule
All Implemented Interfaces:
HttpAuthModule

public class LDAPAuthModule
extends BaseAuthenticationModule

Implementation class for the LDAP authentication provider for Blackboard Learning system. Building Block Developers are able to subclass this in custom authentications. However, specific changes to the way that the provider connects to the LDAP server may not be made and will still be dictated by properties set in the authentication.properties file.

Subclasses must call the authenticate(String, String, SessionStub, boolean) and init( ConfigurationService) methods in this class or the LDAP functionality will not work.

Developers that wish to substantially change the behavior of the LDAP provider can use BaseAuthenticationModule to implement their own LDAP provider using JNDI or another library.

Version:
$Revision: #1 $ $Date: 2005/06/27 $
See Also:
HttpAuthModule

Field Summary
static java.lang.String[] LDAP_PROP_KEYS
           
 
Fields inherited from class blackboard.platform.security.authentication.BaseAuthenticationModule
_authTypeDisplayStr, _config, _logger, IMPL_CLASS_KEY, USE_CHALLENGE_KEY
 
Constructor Summary
LDAPAuthModule()
          Constructor for the LDAP authentication provider.
 
Method Summary
protected  java.lang.String authenticate(java.lang.String userName, java.lang.String password, SessionStub sessionStub, boolean useChallenge)
          Method to support LDAP-based authentication.
 java.lang.String getAuthType()
          Returns a String identifier for the authentication type for a given implementation of HttpAuthModule.
 boolean getErrorFallbackToBb()
          Returns a true if the LDAP provider is configured to "fall back" to the default authentication if an error is encountered using LDAP.
 int getNumServers()
          Returns the number of LDAP servers configured.
 java.lang.String[] getPropKeys()
          Returns a String array of the keys to this authentication module's configuration properties file.
 java.lang.String getRemoteUser(javax.servlet.http.HttpServletRequest request)
          Extracts the CGI variable REMOTE_USER from the incoming request.
 User getUserFromUsernamePassword(java.lang.String username, java.lang.String password)
          Returns the User object for a given username and password.
 boolean getUserNotFoundFallbackToBb()
          Returns true of the LDAP provider is configured to "fall back" to the default authentication if the user is not found in LDAP.
 void init(ConfigurationService cfg)
          Initializes authentication module.
 
Methods inherited from class blackboard.platform.security.authentication.BaseAuthenticationModule
assertRequestAuthenticate, doAuthenticate, doAuthenticate, doLogout, getBundle, getConfigErrs, getCreateAccountAllowed, getDefaultAuthType, getDoAuthenticateParams, getRequestAuthenticateUri, getSecondaryDoAuthenticateParams, getSubConfigErrs, getUseChallenge, isAuthenticated, isExternalAuth, requestAuthenticate, setConfig, setGlobalKeys, validateConfig
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

LDAP_PROP_KEYS

public static final java.lang.String[] LDAP_PROP_KEYS
Constructor Detail

LDAPAuthModule

public LDAPAuthModule()
Constructor for the LDAP authentication provider.

Method Detail

init

public void init(ConfigurationService cfg)
Initializes authentication module.

Specified by:
init in interface HttpAuthModule
Overrides:
init in class BaseAuthenticationModule
Parameters:
cfg - The ConfigurationService for this installation.

getErrorFallbackToBb

public boolean getErrorFallbackToBb()
Returns a true if the LDAP provider is configured to "fall back" to the default authentication if an error is encountered using LDAP.


getUserNotFoundFallbackToBb

public boolean getUserNotFoundFallbackToBb()
Returns true of the LDAP provider is configured to "fall back" to the default authentication if the user is not found in LDAP.


authenticate

protected java.lang.String authenticate(java.lang.String userName,
                                        java.lang.String password,
                                        SessionStub sessionStub,
                                        boolean useChallenge)
                                 throws BbAuthenticationFailedException,
                                        BbSecurityException
Method to support LDAP-based authentication. Uses credentials to look up a user in an LDAP directory, or set of LDAP directories (depending on the configuration).

Overrides:
authenticate in class BaseAuthenticationModule
Parameters:
userName - User name
userToken - this should be the clear text password to use to perform the bind.
Returns:
User key used to load user.
Throws:
blackboard.platform.security.BbAuthenticationFailedException
BbAuthenticationFailedException
BbSecurityException

getUserFromUsernamePassword

public User getUserFromUsernamePassword(java.lang.String username,
                                        java.lang.String password)
                                 throws PersistenceException,
                                        BbAuthenticationFailedException,
                                        BbSecurityException
Returns the User object for a given username and password.

Throws:
PersistenceException
BbAuthenticationFailedException
BbSecurityException

getRemoteUser

public java.lang.String getRemoteUser(javax.servlet.http.HttpServletRequest request)
                               throws BbSecurityException
Extracts the CGI variable REMOTE_USER from the incoming request. Not appropriate for the current LDAP implementation, since we querying the LDAP server via a bind operation within the authenticate method, so currently this method always throws a BbSecurityException.

Parameters:
HttpServletRequest - request
Throws:
BbSecurityException

getNumServers

public int getNumServers()
Returns the number of LDAP servers configured.


getAuthType

public java.lang.String getAuthType()
Returns a String identifier for the authentication type for a given implementation of HttpAuthModule.

Specified by:
getAuthType in interface HttpAuthModule
Overrides:
getAuthType in class BaseAuthenticationModule

getPropKeys

public java.lang.String[] getPropKeys()
Returns a String array of the keys to this authentication module's configuration properties file.

Specified by:
getPropKeys in interface HttpAuthModule
Overrides:
getPropKeys in class BaseAuthenticationModule


Copyright © 2003 Blackboard, Inc. All Rights Reserved.