@@ -35,9 +35,6 @@ public function __construct(YubikeyService $yubikeyService)
3535 * - 0 - authentication failure
3636 * - 100 - just go on. User is not authenticated but there is still no reason to stop
3737 * - 200 - the service was able to authenticate the user
38- *
39- * @param array $user Array containing the userdata
40- * @return int authentication statuscode, one of 0, 100 and 200
4138 */
4239 public function authUser (array $ user ): int
4340 {
@@ -61,7 +58,7 @@ public function authUser(array $user): int
6158 );
6259
6360 // Get Yubikey OTP
64- $ yubikeyOtp = GeneralUtility:: _GP ( 't3-yubikey ' );
61+ $ yubikeyOtp = ( string )( $ _POST [ 't3-yubikey ' ] ?? $ _GET [ ' t3-yubikey ' ] ?? ' ' );
6562 $ this ->logger ->debug ('Yubikey: ' . $ yubikeyOtp );
6663 $ tempYubiKeyIds = GeneralUtility::trimExplode (
6764 chr (10 ),
@@ -73,7 +70,7 @@ public function authUser(array $user): int
7370 $ yubiKeyIds [] = substr ($ tempYubiKeyId , 0 , 12 );
7471 }
7572 // Check, if Yubikey-ID does match with users Yubikey-ID
76- if (in_array (substr ($ yubikeyOtp , 0 , 12 ), $ yubiKeyIds )) {
73+ if (in_array (substr ($ yubikeyOtp , 0 , 12 ), $ yubiKeyIds, true )) {
7774 $ clientId = $ this ->extConf ['yubikeyClientId ' ] ?? 'none ' ;
7875 $ this ->logger ->debug ('Yubikey config - ClientId: ' . $ clientId );
7976
@@ -135,7 +132,7 @@ private function isYubikeyCheckEnabled(): bool
135132 $ yubikeyCheckEnabled = true ;
136133 } elseif (isset ($ this ->extConf ['yubikeyEnableFE ' ]) &&
137134 (bool )$ this ->extConf ['yubikeyEnableFE ' ] &&
138- $ this ->pObj ->loginType == 'FE '
135+ $ this ->pObj ->loginType === 'FE '
139136 ) {
140137 $ yubikeyCheckEnabled = true ;
141138 }
0 commit comments