[TYPO3-english] felogin hook beforeRedirect doesn't work
Jan Wehe
typo3 at wehe-online.de
Fri May 18 15:55:51 CEST 2012
Hello,
thanks for your hint with an authentication services. I read some howtos
and implemented an auth service, but it seems not to be loaded.
ext_localconf.php
===================
if (!defined('TYPO3_MODE')) { die ('Access denied.'); }
t3lib_extMgm::addService($_EXTKEY, 'auth' /* sv type */, 'tx_nwsso_sv1'
/* sv key */,
array(
'title' => 'phpBB Login',
'description' => 'Login user to phpBB with website login',
'subtype' => 'authUserFE,getUserFE',
'available' => TRUE,
'priority' => 80,
'quality' => 80,
'os' => '',
'exec' => '',
'classFile' =>
t3lib_extMgm::extPath($_EXTKEY).'sv1/class.tx_nwsso_sv1.php',
'className' => 'tx_nwsso_sv1',
));
sv1/class.tx_nwsso_sv1.php
============================
class tx_nwsso_sv1 extends tx_sv_authbase {
var $prefixId = 'tx_nwsso_sv1';
var $scriptRelPath = 'sv1/class.tx_nwsso_sv1.php';
var $extKey = 'nw_sso';
var $writeDevLog = true;
function init() {
$available = parent::init();
return $available;
}
function getUser() {
$user = array();
$user['username'] = $this->login['uname'];
$user['password'] = $this->login['uident_text'];
return $user;
}
function authUser($user) {
$OK = false;
// phpBB Login...
return $OK;
}
}
if (defined('TYPO3_MODE') &&
$TYPO3_CONF_VARS[TYPO3_MODE]['XCLASS']['ext/nw_sso/sv1/class.tx_nwsso_sv1.php']) {
include_once($TYPO3_CONF_VARS[TYPO3_MODE]['XCLASS']['ext/nw_sso/sv1/class.tx_nwsso_sv1.php']);
}
Greetings,
On Thu, 17 May 2012 18:57:31 +0200, Jigal van Hemert
<jigal.van.hemert at typo3.org> wrote:
> Hi,
>
> On 17-5-2012 14:33, Jan Wehe wrote:
>> I want to use the username/password to login to an phpBB in the
>> background, is there
>> a hook or another way to get username/password from the felogin form?
>
> Maybe an authentication service is the best in this case. A login
> request is processed by authentication services which are called in
> order of priority. An authentication service is usually used to verify
> the login information, initialize the fe user in the system and then
> indicate if the verification succeeded.
>
> The value it returns can have several meanings:
> - authentication succeeded, no need to check other services
> - authentication failed, try next service
> - authentication failed, stop checking other services
>
> If you create an authentication service with a high priority it will be
> the first one which is tried. Your service can log into phpBB and tell
> TYPO3 that authentication failed and that the next service should be
> tried (or maybe that it should stop checking other services if logging
> in with phpBB failed?)
>
> There are a number of authentication services in TER, such as a demo
> service and an LDAP service. You can use them for inspiration.
More information about the TYPO3-english
mailing list