|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectblackboard.platform.security.authentication.BaseAuthenticationModule
public class BaseAuthenticationModule
Implementation class for the default authentication provider for Blackboard Learning System, also known as RDBMS Authentication. This class can be used as the base class for implementations that will use the Blackboard database as the user directory.
| Nested Class Summary | |
|---|---|
static class |
BaseAuthenticationModule.ValidationSucceeded
Results of password validation. |
| Field Summary | |
|---|---|
protected HttpAuthConfig |
_config
Member variable used to access HttpAuthConfig information. |
protected LogService |
_logger
Member variable to write log message to the LogService. |
static java.lang.String |
IMPL_CLASS_KEY
Used internally by this module. |
static java.lang.String |
USE_CHALLENGE_KEY
Used internally by this module. |
| Constructor Summary | |
|---|---|
BaseAuthenticationModule()
Simple default constructor. |
|
| Method Summary | |
|---|---|
protected void |
assertRequestAuthenticate()
Wrapper for any assertions that should be made before authentication request. |
protected java.lang.String |
authenticate(java.lang.String userName,
java.lang.String userToken,
SessionStub sessionStub,
boolean useChallenge)
Method to support native authentication. |
protected java.lang.String |
authenticate(java.lang.String userName,
java.lang.String userToken,
SessionStub sessionStub,
boolean useChallenge,
boolean isSecondary)
Method to support native authentication. |
java.lang.String |
doAuthenticate(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response)
Performs the work of authentication. |
protected java.lang.String |
doAuthenticate(java.util.Map<java.lang.String,java.lang.String> authenticateParams,
SessionStub sessionStub,
boolean useChallenge)
Implementation specific version of doAuthenticate which does additional checking before calling authenticate. |
protected java.lang.String |
doAuthenticate(java.util.Map<java.lang.String,java.lang.String> authenticateParams,
SessionStub sessionStub,
boolean useChallenge,
boolean isSecondary)
Implementation specific version of doAuthenticate which does additional checking before calling authenticate. |
void |
doLogout(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response)
Implementation method. |
void |
establishSession(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response,
java.lang.String userName)
Creates and associates an AS session with provided user information. |
java.lang.String |
getAuthType()
Returns a String identifier for the authentication type for a given implementation of HttpAuthModule |
protected blackboard.platform.intl.BbResourceBundle |
getBundle()
|
protected java.lang.String |
getConfigErrs()
Collects errors from loading configuration properties for this authentication type. |
boolean |
getCreateAccountAllowed(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response)
getCreateAccountAllowed() Determines based on configuration information, whether users may create new accounts. |
static java.lang.String |
getDefaultAuthType()
Return the default authentication type |
protected java.util.Map<java.lang.String,java.lang.String> |
getDoAuthenticateParams(javax.servlet.http.HttpServletRequest request)
Gets the authentication parameters from the request object. |
java.lang.String[] |
getPropKeys()
Returns a String array of the keys to this authentication module's configuration properties file. |
protected java.lang.String |
getRequestAuthenticateUri(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response)
getRequestAuthenticateURI Indicates the target resource that should receive the current request. |
protected java.util.Map<java.lang.String,java.lang.String> |
getSecondaryDoAuthenticateParams(javax.servlet.http.HttpServletRequest request)
Gets the authentication parameters from the request object. |
protected java.lang.String |
getSubConfigErrs()
Collects errors from loading nested configuration properties for this authentication type. |
boolean |
getUseChallenge()
Determines based on configuration information, whether to use challenge-response authentication. |
void |
init(ConfigurationService cfg)
Initializes authentication module. |
boolean |
isExternalAuth()
Can be used by subclasses to determine whether or not the authentication module is an external authentication module. |
void |
requestAuthenticate(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response)
Implementation method. |
protected static void |
setAuthTypeDisplayStr(java.lang.String authTypeDisplayStr)
|
void |
setConfig(HttpAuthConfig config)
Sets the configuration properties for this authentication type. |
protected void |
setGlobalKeys(javax.servlet.http.HttpServletRequest request)
Set whatever key-value pairs need to be stored for the current session. |
boolean |
suppressFirstLoadError(javax.servlet.http.HttpServletRequest request)
Used to determine if page "hit" is considered an intial load. |
protected void |
validateConfig()
Validates that the configuration properties for this authentication type have been loaded correctly. |
protected BaseAuthenticationModule.ValidationSucceeded |
validatePassword(java.lang.String userToken,
java.lang.String dbUserPass,
boolean useChallenge,
SessionStub sessionStub)
Validates password. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final java.lang.String IMPL_CLASS_KEY
public static final java.lang.String USE_CHALLENGE_KEY
protected LogService _logger
protected HttpAuthConfig _config
| Constructor Detail |
|---|
public BaseAuthenticationModule()
HttpAuthManager calls
Class.newInstance().
| Method Detail |
|---|
protected blackboard.platform.intl.BbResourceBundle getBundle()
protected static void setAuthTypeDisplayStr(java.lang.String authTypeDisplayStr)
public void init(ConfigurationService cfg)
init in interface HttpAuthModulecfg - The ConfigurationService for this installation.public void setConfig(HttpAuthConfig config)
setConfig in interface HttpAuthModuleconfig - The HttpAuthConfig object containing all authentication properties for this authentication type.
protected void validateConfig()
throws blackboard.platform.security.authentication.BbInsufficientArgs
blackboard.platform.security.authentication.BbInsufficientArgsprotected java.lang.String getConfigErrs()
protected java.lang.String getSubConfigErrs()
public java.lang.String[] getPropKeys()
getPropKeys in interface HttpAuthModulepublic boolean isExternalAuth()
public java.lang.String doAuthenticate(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response)
throws BbSecurityException,
BbAuthenticationFailedException,
BbCredentialsNotFoundException
doAuthenticate(Map, SessionStub, boolean) which submits username and password to
the authenticate method.
doAuthenticate in interface HttpAuthModulerequest - the request containing auth credentialsresponse - the response object associated with the current HTTP transaction. This object is not used in this
implementation
BbSecurityException - thrown if an external error prevents authentication from occurring.
BbAuthenticationFailedException - thrown if authentication failed (i.e., wrong password)
BbCredentialsNotFoundException - thrown if no credentials were found in the request
protected java.lang.String doAuthenticate(java.util.Map<java.lang.String,java.lang.String> authenticateParams,
SessionStub sessionStub,
boolean useChallenge)
throws BbSecurityException,
BbAuthenticationFailedException,
BbCredentialsNotFoundException
authenticate.
authenticateParams - -- a Map of request parameter names and valuessessionStub - -- Session informationuseChallenge - -- boolean to signify whether or not authentication is configured for challenge-response
BbSecurityException
BbAuthenticationFailedException
BbCredentialsNotFoundException
protected java.lang.String doAuthenticate(java.util.Map<java.lang.String,java.lang.String> authenticateParams,
SessionStub sessionStub,
boolean useChallenge,
boolean isSecondary)
throws BbSecurityException,
BbAuthenticationFailedException,
BbCredentialsNotFoundException
authenticate.
authenticateParams - -- a Map of request parameter names and valuessessionStub - -- Session informationuseChallenge - -- boolean to signify whether or not authentication is configured for challenge-responseisSecondary - -- whether this is the second attempt; used to handle non-Unicode encoded passwords
BbSecurityException
BbAuthenticationFailedException
BbCredentialsNotFoundExceptionprotected java.util.Map<java.lang.String,java.lang.String> getDoAuthenticateParams(javax.servlet.http.HttpServletRequest request)
protected java.util.Map<java.lang.String,java.lang.String> getSecondaryDoAuthenticateParams(javax.servlet.http.HttpServletRequest request)
public void requestAuthenticate(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response)
throws BbSecurityException
requestAuthenticate in interface HttpAuthModulerequest - The current HTTP request object. Used to get the session objectresponse - The response on which to set SC_UNAUTHORIZED
BbSecurityException - thrown if a run-time error prevents the method from completing.HttpServletResponse.SC_UNAUTHORIZED
protected void assertRequestAuthenticate()
throws BbSecurityException
BbSecurityException - if the configuration has not been set
protected java.lang.String getRequestAuthenticateUri(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response)
throws java.io.IOException,
java.lang.SecurityException,
java.io.FileNotFoundException,
PersistenceException
java.io.IOException
java.lang.SecurityException
java.io.FileNotFoundException
PersistenceException
public void doLogout(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response)
throws BbSecurityException
doLogout in interface HttpAuthModulerequest - the current HTTP request. Used to obtain a session handle.response - the current HTTP response. Passed for completeness, not used.
BbSecurityException - included for completeness. --This implementation will never throw this exception
protected java.lang.String authenticate(java.lang.String userName,
java.lang.String userToken,
SessionStub sessionStub,
boolean useChallenge)
throws BbAuthenticationFailedException,
BbSecurityException
If challenge-response is not used, the processing is greatly simplified: the password is in clear text. The method digests it and compares it against the hashed value stored in the database.
userName - User nameuserToken - this should be either clear text password or hash, depending on the result from
RDBMSAuthUtil.useChallenge().
BbAuthenticationFailedException
BbSecurityException
protected java.lang.String authenticate(java.lang.String userName,
java.lang.String userToken,
SessionStub sessionStub,
boolean useChallenge,
boolean isSecondary)
throws BbAuthenticationFailedException,
BbSecurityException
If challenge-response is not used, the processing is greatly simplified: the password is in clear text. The method digests it and compares it against the hashed value stored in the database.
userName - User nameuserToken - this should be either clear text password or hash, depending on the result from
RDBMSAuthUtil.useChallenge().
BbAuthenticationFailedException
BbSecurityException
protected BaseAuthenticationModule.ValidationSucceeded validatePassword(java.lang.String userToken,
java.lang.String dbUserPass,
boolean useChallenge,
SessionStub sessionStub)
throws BbAuthenticationFailedException
userToken - Password provided by clientdbUserPass - Hashed database passworduseChallenge - Use challenge-response mechanism to validate loginsessionStub - Session information (only needed when useChallenge is true)
BbAuthenticationFailedException - if password is not valid
public boolean getCreateAccountAllowed(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response)
public boolean getUseChallenge()
public java.lang.String getAuthType()
getAuthType in interface HttpAuthModulepublic static java.lang.String getDefaultAuthType()
public boolean suppressFirstLoadError(javax.servlet.http.HttpServletRequest request)
HttpAuthModule implementation.
suppressFirstLoadError in interface HttpAuthModule
protected void setGlobalKeys(javax.servlet.http.HttpServletRequest request)
throws PersistenceException
PersistenceException
public final void establishSession(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response,
java.lang.String userName)
throws BbSecurityException
BbSecurityException
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||