An open API service indexing awesome lists of open source software.

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.

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();
```