https://github.com/inanepain/auth
Stuff to help or add to authentication.
https://github.com/inanepain/auth
Last synced: 2 months ago
JSON representation
Stuff to help or add to authentication.
- Host: GitHub
- URL: https://github.com/inanepain/auth
- Owner: inanepain
- License: unlicense
- Created: 2022-02-21T15:59:34.000Z (over 3 years ago)
- Default Branch: develop
- Last Pushed: 2022-09-17T11:18:32.000Z (over 2 years ago)
- Last Synced: 2025-02-03T21:53:42.631Z (4 months ago)
- Language: PHP
- Size: 13.7 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
Awesome Lists containing this project
README
# Inanepain: Authentication
> $Id$ ($Date$)
Stuff to help with or add to authentication.
## Two Factor Authentication
Generating and verifying tokens and pins.
### Generate Token
```php
$token = new \Inane\Authentication\TwoFactor\Token('Inane');
echo "$token";
```### Verify OTP
```php
$otp = new \Inane\Authentication\TwoFactor\OneTimePin($token);
$valid = $otp->verifyOTP('612777');
```### QRCode URL
```php
$imgUrl = $token->getQRCodeUrl();
// OR
$imgBase64 = $token->getImageBase64();
```