Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save tylerreinhart/11064722 to your computer and use it in GitHub Desktop.
Save tylerreinhart/11064722 to your computer and use it in GitHub Desktop.
Toopher PHP Authentication Example
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