/**
* Private authentication function.
*
* @param string $userID Username for IMSP server.
* @param array $credentials Hash containing 'password' element.
*
* @return boolean True on success / False on failure.
*/
protected function _authenticate($userID, $credentials)
{
// Need to create the Imsp socket here since it requires a user/password
// to create, and we don't have one until this method.
$this->_params['username'] = $userID;
$this->_params['password'] = $credentials['password'];
$this->_imsp = $GLOBALS['injector']->getInstance('Horde_Core_Factory_Imsp')->create(null, $this->_params);
if (!$this->_imsp->authenticate(false)) {
throw new Horde_Auth_Exception('', Horde_Auth::REASON_BADLOGIN);
}
}