DEPRECATION WARNING

This documentation is not using the current rendering mechanism and is probably outdated. The extension maintainer should switch to the new system. Details on how to use the rendering mechanism can be found here.

For Developers

The PxHybridAuth extension is designed in a way which should make it easy to integrate other social providers by developers.

Signal slots

HybridAuth offers a the following SignalSlots (Extbase pendant to Hooks) to extend the functions from your extension.

Signal Class Name Signal Name Located in File Located in Method Description
Portrino\PxHybridAuth\Service\SocialLoginAuthenticationService returnUrl SocialLoginAuthenticationService.php getUser() Slot is called after the returnUrl was build
Portrino\PxHybridAuth\Service\SocialLoginAuthenticationService getUser SocialLoginAuthenticationService.php getUser() Slot is called after the user object is created
Portrino\PxHybridAuth\Service\SocialLoginAuthenticationService authUser SocialLoginAuthenticationService.php authUser() Slot is called after social authentication is done
Portrino\PxHybridAuth\Controller\AbstractUserController loginErrorBeforeRedirect AbstractUserController.php initializeNewLoginAction() Slot is called if an error occurred during initializing the newLoginAction()
Portrino\PxHybridAuth\Controller\IdentityController afterCreateAction IdentityController.php createAction() Slot is called after create identity, before the redirect takes place
Portrino\PxHybridAuth\Controller\IdentityController afterRemoveAction IdentityController.php removeAction() Slot is called after remove identity, before the redirect takes place

Example

ext_localconf.php

if (\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::isLoaded('px_hybrid_auth')) {

  $signalSlotDispatcher->connect(
      'Portrino\PxHybridAuth\Service\SocialLoginAuthenticationService',
      'getUser',
      'Portrino\PxRegister\Slots\HybridAuthSlot',
      'getUser',
      FALSE
  );

  $signalSlotDispatcher->connect(
      'Portrino\PxHybridAuth\Service\SocialLoginAuthenticationService',
      'authUser',
      'Portrino\PxRegister\Slots\HybridAuthSlot',
      'authUser',
      FALSE
  );

  $signalSlotDispatcher->connect(
      'Portrino\PxHybridAuth\Controller\AbstractUserController',
      'loginErrorBeforeRedirect',
      'Portrino\PxRegister\Slots\HybridAuthSlot',
      'loginErrorBeforeRedirect',
      FALSE
  );
}

HybridAuthSlot.php

/**
 * Class HybridAuthSlot
 *
 * @package Portrino\PxRegister\Slots
 */
class HybridAuthSlot {

    /**
     * authUser
     *
     * @param array $user
     * @param int $result
     */
    public function authUser($user, &$result) {
        ...
    }

    /**
     * loginErrorBeforeRedirect
     *
     * @param \Portrino\PxHybridAuth\Controller\AbstractUserController $pObj
     * @param \TYPO3\CMS\Extbase\Mvc\Request $request
     */
    public function loginErrorBeforeRedirect($pObj, $request) {
        ...
    }
}