[TYPO3-dev] Using fe_user->createUserSession() to log in and create fe session in TYPO3 4.5

Jochen Rieger j.rieger at connecta.ag
Tue Nov 1 15:56:50 CET 2011


Hi Folks,

much has been written about the task mentioned in the subject.

We are experiencing problems with TYPO3 4.5 using this kind of login via 
PHP.


What we do / want:

We use the hook "postUserLookUp" to create a user session based on some 
apache header data which is provided by an SSO agent apache module. All 
existing SSO users exist in fe_users table as well.


How we try to solve it:

-- snip --
$info = $GLOBALS['TSFE']->fe_user->getAuthInfoArray();

// make sure the right pid is used
$info['db_user']['checkPidList'] = 1;
$info['db_user']['check_pid_clause'] = 'AND pid IN(38)';

$fe_user = $GLOBALS['TSFE']->fe_user->fetchUserRecord($info['db_user'], 
$usernameFromHeaders);
         $GLOBALS['TSFE']->fe_user->createUserSession($fe_user); 

$GLOBALS['TSFE']->fe_user->loginSessionStarted = true;
$GLOBALS['TSFE']->fe_user->fetchGroupData();
-- snap --


I think we cannot use the auth service because we need to post-request 
against the SSO agent, then we read the apache headers and need to 
create a fe_user session based on that. With the auth service we 
couldn't manage to create the SSO session apache header data.

Using our above code The user object seems fully there when debugging 
$GLOBALS['TSFE']->fe_user->user after the login. But pages that should 
be shown after login won't show up in the menu, the felogin plugin won't 
show "logged in as...".

Is there anything else we missed? Anything else that's needed in 4.5 for 
a *real* login and user session?

Any hint highly appreciated.

Thanks,
Jochen



More information about the TYPO3-dev mailing list