Skip to content

Instantly share code, notes, and snippets.

@tylerreinhart
Last active August 29, 2015 14:00
Show Gist options
  • Save tylerreinhart/11064524 to your computer and use it in GitHub Desktop.
Save tylerreinhart/11064524 to your computer and use it in GitHub Desktop.
Toopher Java Authentication Example
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);
if (auth.pending == false && auth.granted == true) {
// Success!
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment