‪TYPO3CMS  9.5
RsaAuthService.php
Go to the documentation of this file.
1 <?php
2 namespace ‪TYPO3\CMS\Rsaauth;
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 
19 
28 {
32  protected ‪$rsaEncryptionDecoder;
33 
40  public ‪$extKey = 'rsaauth';
41 
48  public ‪$prefixId = 'tx_rsaauth_sv1';
49 
58  public function ‪processLoginData(array &$loginData, $passwordTransmissionStrategy)
59  {
60  $isProcessed = false;
61  if ($passwordTransmissionStrategy === 'rsa') {
62  $password = $loginData['uident'];
63  if (strpos($password, 'rsa:') === 0) {
64  $decryptedPassword = $this->‪getRsaEncryptionDecoder()->‪decrypt($password);
65  if ($decryptedPassword !== $password) {
66  $loginData['uident_text'] = $decryptedPassword;
67  $isProcessed = true;
68  } else {
69  $this->logger->debug('Process login data: Failed to RSA decrypt password');
70  }
71  } else {
72  $this->logger->debug('Process login data: passwordTransmissionStrategy has been set to "rsa" but no rsa encrypted password has been found.');
73  }
74  }
75  return $isProcessed;
76  }
77 
83  public function ‪init()
84  {
85  return parent::init() && $this->‪getRsaEncryptionDecoder()->‪isAvailable();
86  }
87 
91  protected function ‪getRsaEncryptionDecoder()
92  {
93  if ($this->rsaEncryptionDecoder === null) {
94  $this->rsaEncryptionDecoder = GeneralUtility::makeInstance(RsaEncryptionDecoder::class);
95  }
96 
98  }
99 }
‪TYPO3\CMS\Rsaauth\RsaAuthService\processLoginData
‪bool processLoginData(array &$loginData, $passwordTransmissionStrategy)
Definition: RsaAuthService.php:55
‪TYPO3\CMS\Rsaauth\RsaAuthService\getRsaEncryptionDecoder
‪RsaEncryptionDecoder getRsaEncryptionDecoder()
Definition: RsaAuthService.php:88
‪TYPO3\CMS\Rsaauth\RsaAuthService\$rsaEncryptionDecoder
‪RsaEncryptionDecoder $rsaEncryptionDecoder
Definition: RsaAuthService.php:31
‪TYPO3\CMS\Rsaauth\RsaEncryptionDecoder\decrypt
‪string array decrypt($data)
Definition: RsaEncryptionDecoder.php:38
‪TYPO3\CMS\Rsaauth\RsaEncryptionDecoder
Definition: RsaEncryptionDecoder.php:21
‪TYPO3\CMS\Rsaauth\RsaAuthService\$extKey
‪string $extKey
Definition: RsaAuthService.php:38
‪TYPO3\CMS\Rsaauth\RsaEncryptionDecoder\isAvailable
‪bool isAvailable()
Definition: RsaEncryptionDecoder.php:54
‪TYPO3\CMS\Core\Authentication\AuthenticationService
Definition: AuthenticationService.php:30
‪TYPO3\CMS\Rsaauth\RsaAuthService\$prefixId
‪string $prefixId
Definition: RsaAuthService.php:45
‪TYPO3\CMS\Rsaauth\RsaAuthService\init
‪bool init()
Definition: RsaAuthService.php:80
‪TYPO3\CMS\Rsaauth\RsaAuthService
Definition: RsaAuthService.php:28
‪TYPO3\CMS\Core\Utility\GeneralUtility
Definition: GeneralUtility.php:45
‪TYPO3\CMS\Rsaauth