Skip to content

Instantly share code, notes, and snippets.

@tylerreinhart
tylerreinhart / toopher-get-auth-request-status-json-response-example.js
Created Apr 18, 2014
Toopher Get Authentication Request Status JSON Response Example
View toopher-get-auth-request-status-json-response-example.js
{
'granted':True,
'pairing':{
'pairing_request_id':'1abc2d34-e567-8ff9-ba27-df72f4e9818a',
'totp_length':6,
'created':'2013-06-11 23:59:59',
'enabled':True,
'modified':'2013-06-11 23:59:59',
'user':{
'name':'seth@toopher.com',
@tylerreinhart
tylerreinhart / toopher-get-pairing-json-response-example.js
Created Apr 18, 2014
Toopher Get Pairing JSON Response Example
View toopher-get-pairing-json-response-example.js
{
'pairing_request_id':'1abc2d34-e567-8ff9-ba27-df72f4e9818a',
'totp_length':6,
'created':'2013-06-11 23:59:59',
'enabled':True,
'modified':'2013-06-11 23:59:59',
'user':{
'name':'seth@toopher.com',
'created':'2013-06-11 23:59:59',
'id':'s374db3d-b269-45c6-8e83-2e647f52ba51',
@tylerreinhart
tylerreinhart / toopher-authentication-json-response-example.js
Created Apr 18, 2014
Toopher Authentication JSON Response Example
View toopher-authentication-json-response-example.js
{
'granted':False,
'pairing':{
'pairing_request_id':'1abc2d34-e567-8ff9-ba27-df72f4e9818a',
'totp_length':6,
'created':'2013-06-11 23:59:59',
'enabled':True,
'modified':'2013-06-11 23:59:59',
'user':{
'name':'seth@toopher.com',
@tylerreinhart
tylerreinhart / toopher-pairing-json-response-example.js
Created Apr 18, 2014
Toopher Pairing JSON Response Example
View toopher-pairing-json-response-example.js
{
'pairing_request_id':'1abc2d34-e567-8ff9-ba27-df72f4e9818a',
'totp_length':6,
'created':'2013-06-11 20:53:54',
'enabled':False,
'modified':'2013-06-11 20:53:54',
'user':{
'name':'seth@toopher.',
'created':'2013-06-11 23:59:59',
'id':'s374db3d-b269-45c6-8e83-2e647f52ba51',
@tylerreinhart
tylerreinhart / toopher-dotnet-authentication-example.cs
Created Apr 18, 2014
Toopher dotnet Authentication Example
View toopher-dotnet-authentication-example.cs
using Toopher;
// Create an API object using your credentials
ToopherApi api = new ToopherApi("<your consumer key>", "<your consumer secret>");
// Authenticate a log in
AuthenticationStatus auth = api.Authenticate(pairing.id, "my computer");
// Once they've responded you can then check the status
AuthenticationStatus status = api.GetAuthenticationStatus(auth.id);
View toopher-dotnet-pairing-example.cs
using Toopher;
// Create an API object using your credentials
ToopherApi api = new ToopherApi("<your consumer key>", "<your consumer secret>");
// Step 1 - Pair with their phone's Toopher app
PairingStatus pairing = api.Pair("pairing phrase", "username@yourservice.com");
View toopher-perl-authentication-example.pm
use ToopherAPI
# Create an API object using your credentials
my $api = new ToopherApi("<your consumer key>", "<your consumer secret>");
# Step 2 - Authenticate a log in
my $auth = $api->authenticate($pairing_status->id, "my computer")
# Once they've responded you can then check the status
my $auth_status = $api->get_authentication_status($auth->id)
@tylerreinhart
tylerreinhart / toopher-perl-pairing-example.pm
Created Apr 18, 2014
toopher-perl-pairing-example.com
View toopher-perl-pairing-example.pm
use ToopherAPI
# Create an API object using your credentials
my $api = new ToopherApi("<your consumer key>", "<your consumer secret>");
# Step 1 - Pair with their phone's Toopher app
my $pairing_status = $api->pair("pairing phrase", "username@yourservice.com");
View toopher-php-authentication-example.php
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']){
View toopher-php-pairing-example.php
require_once("toopher_api.php");
// Create an API object using your credentials
$toopherApi = new ToopherAPI($key, $secret);
// Step 1 - Pair with their phone's Toopher app
$pairing = $toopherApi->pair("pairing phrase", "username@yourservice.com");