Forked from tylerreinhart/toopher-php-authentication-example.php
Last active
August 29, 2015 14:16
-
-
Save smholloway/3ec23134be59d5bd9412 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require_once("toopher_api.php"); | |
// Create an API object using your credentials | |
$toopherApi = new ToopherAPI($key, $secret); | |
// Authenticate a log in | |
$authStatus = $toopherApi->authenticate($pairingStatus['id'], "my computer"); | |
// Once they've responded you can then check the status | |
while($authStatus['pending']){ | |
$authStatus = $toopherApi->getAuthenticationStatus($authStatus['id']); | |
sleep(1); | |
} | |
if($authStatus['granted']){ | |
// Success! | |
} else { | |
// user declined the authorization! | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment