PHP code example of edunext-eu / simplesamlphp-module-simpletotp
1. Go to this page and download the library: Download edunext-eu/simplesamlphp-module-simpletotp 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/ */
edunext-eu / simplesamlphp-module-simpletotp example snippets
'authproc.idp' => [
34 => [
'class' => 'simpletotp:mfa',
'secret_attr' => 'totp_secret',
'enforce_mfa' => false,
'allow_empty_secret' => false,
'totp_window' => 0,
'max_attempts' => 5,
'attempt_window' => 300,
'totp_rate_limit_storage' => 'session',
'totp_rate_limit_key' => 'uid',
'restart_enabled' => false,
'clear_cookies' => [],
],
35 => [
'class' => 'core:AttributeMap',
'name2oid',
],
],
'totp_rate_limit_storage' => 'both',
'totp_rate_limit_key' => 'uid',
'restart_enabled' => true,
'clear_cookies' => [],
// Optional when the surrounding state has no suitable restart URL:
//'restart_url' => 'https://idp.example.org/your-login-entry-point',
'module.enable' => [
'simpletotp' => true,
],
'authproc.sp' => [
10 => [
'class' => 'simpletotp:mfa',
'secret_attr' => 'totp_secret',
'enforce_mfa' => false,
'allow_empty_secret' => false,
'totp_rate_limit_storage' => 'session',
],
],