Skip to content

Devzstudio/AuthPin-PHP

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 
 
 
 
 

Repository files navigation

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

$api = "";
require_once(authpin.class.php);
$authpin = new AuthPin($api);

Two-Factor Registeration

// Returns the QR code. Your user can scan this QR using AuthPin app / Website.
$email = "[email protected]";
echo $authpin->register($email);

Two-Factor Verification

$pin = "1234";
if($authpin->verify($pin,$email))
{
 echo "Valid Pin";
}
else 
{
 echo "Invalid Pin";
}

SMS OTP

// 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

$smscode = "1234";
if($authpin->verifyotp( $smscode , $hash))
{
 echo "Valid OTP";
}
else 
{
 echo "Invalid OTP";
}

API Info

https://authpin.com/developer

Releases

No releases published

Packages

No packages published

Languages