Skip to content

Instantly share code, notes, and snippets.

View toopher-ruby-authentication-example.rb
require 'toopher_api'
# Create an API object using your credentials
toopher = ToopherAPI.new("key", "secret")
# Authenticate a log in
auth_status = toopher.authenticate(pairing.id, 'my computer')
# Once they've responded you can then check the status
while auth_status.pending
View toopher-ruby-pairing-example.rb
require 'toopher_api'
# Create an API object using your credentials
toopher = ToopherAPI.new("key", "secret")
# Step 1 - Pair with their phone's Toopher app
pairing = toopher.pair("pairing phrase", "username@yourservice.com")
@tylerreinhart
tylerreinhart / toopher-java-authentication-example.java
Last active Aug 29, 2015
Toopher Java Authentication Example
View toopher-java-authentication-example.java
import com.toopher.*;
// Create an API object using your credentials
ToopherApi api = new ToopherApi("<your consumer key>", "<your consumer secret>");
// Step 2 - 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-java-pairing-example.java
import com.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-python-authenticating-example.py
Created Apr 17, 2014
Toopher Python Authentication Example
View toopher-python-authenticating-example.py
import toopher
# Create an API object using your credentials
api = toopher.ToopherApi("<your consumer="" key="">", "<your consumer="" secret="">")
auth = api.authenticate(pairing_status.id, "my computer")
# Once they've responded you can then check the status
auth_status = api.get_authentication_status(auth.id)
if (auth_status.pending == false and auth_status.granted == true):
View toopher-python-pairing-example.py
import toopher
# Create an API object using your credentials
api = toopher.ToopherApi("<your consumer="" key="">", "<your consumer="" secret="">")
# Step 1 - Pair with their phone's Toopher app
pairing_status = api.pair("pairing phrase", "username@yourservice.com")
@tylerreinhart
tylerreinhart / gist:10781282
Created Apr 15, 2014
Toopher Ptyhon Example
View gist:10781282
import toopher
# Create an API object using your credentials
api = toopher.ToopherApi("<your consumer="" key="">", "<your consumer="" secret="">")
# Step 1 - Pair with their phone's Toopher app
pairing_status = api.pair("pairing phrase", "username@yourservice.com")
# Step 2 - Authenticate a log in
auth = api.authenticate(pairing_status.id, "my computer")