https://github.com/devzstudio/authpin-php
AuthPin PHP Class
https://github.com/devzstudio/authpin-php
Last synced: about 2 months ago
JSON representation
AuthPin PHP Class
- Host: GitHub
- URL: https://github.com/devzstudio/authpin-php
- Owner: Devzstudio
- License: gpl-3.0
- Created: 2016-09-23T15:17:27.000Z (almost 10 years ago)
- Default Branch: master
- Last Pushed: 2016-09-23T15:49:53.000Z (almost 10 years ago)
- Last Synced: 2025-01-14T15:25:20.085Z (over 1 year ago)
- Language: PHP
- Homepage: https://www.authpin.com
- Size: 21.5 KB
- Stars: 1
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README

# Installation
* Obtain API Key from https://www.authpin.com
* Include authpin.class.php in your script.
* Check example.php for basic usage.
# Usage
Include authpinclass.php class and create object
```php
$api = "";
require_once(authpin.class.php);
$authpin = new AuthPin($api);
```
# Two-Factor Registeration
```php
// Returns the QR code. Your user can scan this QR using AuthPin app / Website.
$email = "dev@authpin.com";
echo $authpin->register($email);
```
# Two-Factor Verification
```php
$pin = "1234";
if($authpin->verify($pin,$email))
{
echo "Valid Pin";
}
else
{
echo "Invalid Pin";
}
```
# SMS OTP
```php
// Send OTP to phone
// Hash will be returned after OTP send . You need to pass the hash to verify the SMS
$phone="9xxxxxxxxx";
$country = "IN";
$hash = $authpin->sendOTP($phone,$county);
```
# SMS OTP Verification
```php
$smscode = "1234";
if($authpin->verifyotp( $smscode , $hash))
{
echo "Valid OTP";
}
else
{
echo "Invalid OTP";
}
```
# API Info
https://authpin.com/developer