[TYPO3-dev] How could I create services in 6.x

Xavier Perseguers xavier at typo3.org
Fri May 30 11:58:51 CEST 2014


Hi Jose,

Jose Cuenca wrote:
> Hello, I'm new in TYPO3 and I'd like to make an authentication service.
> (I want to ask to PWM if the account is expired before login, I think
> that the service is the best option)
> I'd read that I can't make "Services" with Extension Builder. How could
> I do it TYPO3 6.x?
> 
> I've read that I could see in TER but those Extensions are vey big and I
> don't know wich folders and files  are necesary.
> Please help me!

How services work: http://docs.typo3.org/typo3cms/Typo3ServicesReference/

In your case, you'll need to implement getUserFE/authUserFE if working
for Frontend login and getUserBE/authUserBE is working in Backend.

System extension OpenID (typo3/sysext/openid) is registering like that
(in ext_localconf.php):

// Register OpenID authentication service with TYPO3
\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addService(
	$_EXTKEY,
	'auth',
	'tx_openid_service',
	array(
		'title' => 'OpenID Authentication',
		'description' => 'OpenID authentication service for Frontend and Backend',
		'subtype' => 'getUserFE,authUserFE,getUserBE,authUserBE',
		'available' => TRUE,
		'priority' => 75,
		// Must be higher than for \TYPO3\CMS\Sv\AuthenticationService (50) or
\TYPO3\CMS\Sv\AuthenticationService will log failed login attempts
		'quality' => 50,
		'os' => '',
		'exec' => '',
		'className' => 'TYPO3\\CMS\\Openid\\OpenidService'
	)
);

Start like that, by copying the skeleton.

Have fun!

-- 
Xavier Perseguers
TYPO3 CMS Team Member

TYPO3 .... inspiring people to share!
Get involved: http://typo3.org




More information about the TYPO3-dev mailing list