[TASK] Remove @author lines
[Packages/TYPO3.CMS.git] / typo3 / sysext / openid / Classes / OpenidEid.php
1 <?php
2 namespace TYPO3\CMS\Openid;
3
4 /*
5 * This file is part of the TYPO3 CMS project.
6 *
7 * It is free software; you can redistribute it and/or modify it under
8 * the terms of the GNU General Public License, either version 2
9 * of the License, or any later version.
10 *
11 * For the full copyright and license information, please read the
12 * LICENSE.txt file that was distributed with this source code.
13 *
14 * The TYPO3 project - inspiring people to share!
15 */
16
17 use TYPO3\CMS\Core\Utility\GeneralUtility;
18 use TYPO3\CMS\Core\Utility\HttpUtility;
19 use TYPO3\CMS\Frontend\Utility\EidUtility;
20
21 /**
22 * This class is the OpenID return script for the TYPO3 Frontend.
23 */
24 class OpenidEid {
25
26 /**
27 * Processes eID request.
28 *
29 * @return void
30 */
31 public function main() {
32 // Due to the nature of OpenID (redrections, etc) we need to force user
33 // session fetching if there is no session around. This ensures that
34 // our service is called even if there is no login data in the request.
35 // Inside the service we will process OpenID response and authenticate
36 // the user.
37 $GLOBALS['TYPO3_CONF_VARS']['SVCONF']['auth']['FE_fetchUserIfNoSession'] = TRUE;
38 // Initialize Frontend user
39 EidUtility::initFeUser();
40 // Redirect to the original location in any case (authenticated or not)
41 @ob_end_clean();
42
43 $location = GeneralUtility::_GP('tx_openid_location');
44 $signature = GeneralUtility::hmac($location, 'openid');
45 if ($signature === GeneralUtility::_GP('tx_openid_location_signature')) {
46 HttpUtility::redirect($location, HttpUtility::HTTP_STATUS_303);
47 }
48 }
49
50 }