[TYPO3-dev] three TYPO3 website and one auth service

Mathias Schreiber [TYPO3] mathias at typo3.org
Mon Oct 8 14:19:07 CEST 2007


Bartosz Aninowski schrieb:
> I want to implement single user database for 3 websites.
> I want to store only user and password not website specific data.
> For example:
> 1. user A creates account in web1
> 2. plugin checks if user already exist in external database
> 3. new user and password are inserted in external database
> 4. rest of data are stored in local fe_user table
> 
> Has anoyone of you done this before?
> Any hints?

Authenticate against an external system.
Quite simple.

Set up a SOAP or whatevr service which gets username and password and 
then sign up a "ghost" user in your other sites.

Loggin in FE_USERS remotely is done like this:

$loginData=array(
         'uname' => $userdata['username'],
         'uident'=> $userdata['password'],
         'status' =>'login'
);
$GLOBALS['TSFE']->fe_user->checkPid = FALSE;
$info = $GLOBALS['TSFE']->fe_user->getAuthInfoArray();
$user = $GLOBALS['TSFE']->fe_user->fetchUserRecord( $info['db_user'],
$loginData['uname'] );
$ok=$GLOBALS['TSFE']->fe_user->compareUident( $user, $loginData );
if( $ok ) {
         $GLOBALS['TSFE']->fe_user->createUserSession( $user );
         $GLOBALS['TSFE']->loginUser = 1;
         $GLOBALS['TSFE']->fe_user->start();
}

-- 
T3A AM
Rocking TYPO3 since 3.1b1




More information about the TYPO3-dev mailing list