Skip to content

Instantly share code, notes, and snippets.

@tylerreinhart
tylerreinhart / toopher-get-auth-request-status-json-response-example.js
Created April 18, 2014 21:28
Toopher Get Authentication Request Status JSON Response Example
{
'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 April 18, 2014 21:27
Toopher Get Pairing JSON Response Example
{
'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 April 18, 2014 21:24
Toopher Authentication JSON Response Example
{
'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 April 18, 2014 21:23
Toopher Pairing JSON Response Example
{
'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 April 18, 2014 21:19
Toopher dotnet Authentication Example
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);
@tylerreinhart
tylerreinhart / toopher-dotnet-pairing-example.cs
Created April 18, 2014 21:18
Toopher dotnet Pairing Example
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");
@tylerreinhart
tylerreinhart / toopher-perl-authentication-example.pm
Created April 18, 2014 21:16
Toopher Perl Authentication Example
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 April 18, 2014 21:16
toopher-perl-pairing-example.com
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");
@tylerreinhart
tylerreinhart / toopher-php-authentication-example.php
Created April 18, 2014 21:15
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']){
@tylerreinhart
tylerreinhart / toopher-php-pairing-example.php
Created April 18, 2014 21:13
Toopher PHP Pairing Example
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");