twofactor_yubikey icon indicating copy to clipboard operation
twofactor_yubikey copied to clipboard

PHP: each() is deprecated

Open My1 opened this issue 6 years ago • 5 comments

The Yubico Plugin spawns a little PHP warning if using PHP >= 7.2 (which basically means any version that is currently fully supported, as PHP 7.1 is down to security only.

The each() function is deprecated. This message will be suppressed on further calls at apps/twofactor_yubikey/vendor/auth_yubico/Yubico.php#395

My1 avatar Jan 14 '19 01:01 My1

This is an issue with the Yubico library. There is a fix in the gifu development version but not in the current release version. I will look at migrating to the development version. Hopefully the api remains the dame.

jaark avatar Jan 14 '19 19:01 jaark

I have always used https://github.com/multiOTP/yubicloud-class-php for my yubicloud business, also because it diesnt depend on anything, the business seems the same as described.

  • include/require the file
  • create a new instance
  • feed it your api data
  • feed it your OTPs and take the response

just the reply handling seems a bit different. 'OK' means valid the rest is an error

My1 avatar Jan 15 '19 06:01 My1

Upgraded the Yubico library.

Ther are a couple of minor usage changes, the useSSL flag now has no function and the authentication server needs to be specified as a full URL (instead of just host/path previously)

jaark avatar Apr 14 '19 09:04 jaark

I think this is working. I had a few issues originally but that could have been my Internet connection as it seems solid now with no changes to the server interaction layer.

jaark avatar Apr 16 '19 10:04 jaark

Hello, I have the same problem. If I activate the app and enter API information, the registration will work properly. However, as soon as a user wants to remove the key, the following error message appears:

Undefined property: OCA\TwoFactor_Yubikey\Service\Yubiotp::$provider at /var/www/nextcloud/apps/twofactor_yubikey/lib/Service/Yubiotp.php#182

and

TypeError: Argument 1 passed to OC\Authentication\TwoFactorAuth\Registry::disableProviderFor() must implement interface OCP\Authentication\TwoFactorAuth\IProvider, null given, called in /var/www/nextcloud/apps/twofactor_yubikey/lib/Service/Yubiotp.php on line 182

and The each() function is deprecated. This message will be suppressed on further calls at /var/www/nextcloud/apps/twofactor_yubikey/vendor/auth_yubico/Yubico.php#395

The user will not be able to log in afterwards because Nextcloud requires authentication with YubiKey How can I fix that?

Mak36 avatar Apr 24 '19 16:04 Mak36