Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/shiwildy/phptotp
A simple TOTP library for PHP
https://github.com/shiwildy/phptotp
auth authenticator googleauth mfa mfa-authenticator multiauth phptotp totp twa two-factor-authentication
Last synced: 6 days ago
JSON representation
A simple TOTP library for PHP
- Host: GitHub
- URL: https://github.com/shiwildy/phptotp
- Owner: shiwildy
- License: mit
- Created: 2024-11-02T17:49:44.000Z (10 days ago)
- Default Branch: main
- Last Pushed: 2024-11-02T18:26:09.000Z (10 days ago)
- Last Synced: 2024-11-02T18:42:08.910Z (10 days ago)
- Topics: auth, authenticator, googleauth, mfa, mfa-authenticator, multiauth, phptotp, totp, twa, two-factor-authentication
- Language: PHP
- Homepage: https://github.com/shiwildy/PHPTOTP
- Size: 0 Bytes
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# PHPTOTP
A simple TOTP library for PHP## Installation
```bash
composer require shiwildy/phptotp
```## Example
```php
getSecret();
echo "Secret Key: " . $secret . PHP_EOL;
// Generate Current auth code
$auth = $phptotp->getAuth($secret);
echo "Current Auth Code:" . $auth . PHP_EOL;
// Verify Auth code with secret key
$verify = $phptotp->verify($auth, $secret);
if ($verify === true) {
echo "Verify status: Correct" . PHP_EOL;
} else {
echo "Verify status: Incorrect" . PHP_EOL;
}
// Generate TOTP Link
$qrcodelink = $phptotp->getQRCodeUrl("[email protected]", "MyApp", $secret);
echo "Importable Link for QR: " . $qrcodelink . PHP_EOL;
?>
```## Contributing
Contributions are welcome! Please open an issue or submit a pull request for any enhancements or bug fixes.## License
This project licensed under The MIT License