|
8 | 8 |
|
9 | 9 | Version 3.x requires at least PHP 8.2.
|
10 | 10 |
|
| 11 | +### Constructor signature change |
| 12 | + |
| 13 | +In order to ensure users of this library make a conscious choice of QR Code Provider, the QR Code Provider is now a mandatory argument, in first place. |
| 14 | + |
| 15 | +If you didn't provide one explicitly before, you can get the old behavior with: |
| 16 | + |
| 17 | +~~~php |
| 18 | +use RobThree\Auth\TwoFactorAuth; |
| 19 | +use RobThree\Auth\Providers\Qr\QRServerProvider; |
| 20 | +$tfa = new TwoFactorAuth(new QRServerProvider()); |
| 21 | +~~~ |
| 22 | + |
| 23 | +If you provided one before, the order of the parameters have been changed, so simply move the QRCodeProvider argument to the first place or use named arguments. |
| 24 | + |
| 25 | +Documentation on selecting a QR Code Provider is available here: [QR Code Provider documentation](https://robthree.github.io/TwoFactorAuth/qr-codes.html). |
| 26 | + |
| 27 | +### Default secret length |
| 28 | + |
| 29 | +The default secret length has been increased from 80 bits to 160 bits (RFC4226) PR #117. This might cause an issue in your application if you were previously storing secrets in a column with restricted size. This change doesn't impact existing secrets, only new ones will get longer. |
| 30 | + |
| 31 | +Previously a secret was 16 characters, now it needs to be stored in a 32 characters width column. |
| 32 | + |
| 33 | +You can keep the old behavior by setting `80` as argument to `createSecret()` (not recommended, see [#117](https://github.com/RobThree/TwoFactorAuth/pull/117) for further discussion). |
| 34 | + |
11 | 35 | ## Other changes
|
12 | 36 |
|
13 | 37 | * The new PHP attribute [SensitiveParameter](https://www.php.net/manual/en/class.sensitiveparameter.php) was added to the code, to prevent accidental leak of secrets in stack traces.
|
| 38 | +* Likely not breaking anything, but now all external QR Code providers use HTTPS with a verified certificate, see #126. |
| 39 | +* The CSPRNG is now exclusively using `random_bytes()` PHP function. Previously a fallback to `openssl` or non cryptographically secure PRNG existed, they have been removed (#122) |
14 | 40 |
|
15 | 41 | # Version 2.x
|
16 | 42 |
|
|
0 commit comments