* * 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 { /** * 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() { /** @var \TYPO3\CMS\Extensionmanager\Utility\ConfigurationUtility $configurationUtility */ $configurationUtility = $this->objectManager->get(\TYPO3\CMS\Extensionmanager\Utility\ConfigurationUtility::class); $extensionConfiguration = $configurationUtility->getCurrentConfiguration('tx_dj_discourse_sso'); // Check mandatory settings. if (isset($extensionConfiguration['redirect_url']) === false) { $errorText = '