PHP code example of silverstripe / totp-authenticator
1. Go to this page and download the library: Download silverstripe/totp-authenticator library. Choose the download type require. 2. Extract the ZIP file and open the index.php. 3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
silverstripe / totp-authenticator example snippets
class MyTOTPRegisterHandlerExtension extends Extension
{
public function updateTotp(\OTPHP\TOTPInterface $totp, \SilverStripe\Security\Member $member)
{
$totp->setLabel($member->getCustomTOTPLabel());
$totp->setIssuer('My web project');
}
}
php -r 'echo substr(base64_encode(random_bytes(32)), 0, 32) . "\n";'