* * All rights reserved * * This script is part of the TYPO3 project. The TYPO3 project is * free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 3 of the License, or * (at your option) any later version. * * The GNU General Public License can be found at * http://www.gnu.org/copyleft/gpl.html. * * This script is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * This copyright notice MUST APPEAR in all copies of the script! ***************************************************************/ use TYPO3\CMS\Core\Utility\GeneralUtility; use TYPO3\CMS\Extbase\Mvc\Controller\ActionController; use \TYPO3\CMS\Extensionmanager\Utility\ConfigurationUtility; /** * Controller for the Member object */ class SsoController extends ActionController { /** * Configuration Utility (see definitions in ext_conf_template.txt). * * @var \TYPO3\CMS\Extensionmanager\Utility\ConfigurationUtility $configurationUtility * @inject */ public $configurationUtility; /** * Compare if signed data matches given signature. * * @param string $data Signed data to be compared with. * @param string $sig Signature to be compared with. * * @return boolean */ private function _hashsAreEqual($data, $sig) { if ($data === null || $sig === null || is_string($data) === false || is_string($sig) === false) { return false; } if (strlen($data) !== strlen($sig)) { return false; } if (strcmp($data, $sig) === 0) { return true; } return false; }//end _hashsAreEqual() /** * Authenticate action. * * @return string */ public function authenticateAction() { $extKey = 'dj_discourse_sso'; /** @var \TYPO3\CMS\Extensionmanager\Utility\ConfigurationUtility $configurationUtility */ $extensionConfiguration = $this->configurationUtility->getCurrentConfiguration($extKey); GeneralUtility::devLog('authenticateAction', $extKey, 0, array('config' => $extensionConfiguration)); // Check mandatory settings. if (isset($extensionConfiguration['redirect_url']) === false) { $errorText = '