Created
April 18, 2014 21:12
-
-
Save tylerreinhart/11064644 to your computer and use it in GitHub Desktop.
Toopher Ruby Authentication Example
This file contains 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 '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 | |
auth_status = toopher.get_authentication_status(auth_status.id) | |
sleep(1) | |
end | |
if auth_status.granted | |
# Success! | |
else | |
# user declined the authorization! | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment