Created
September 19, 2010 01:46
-
-
Save nov/586267 to your computer and use it in GitHub Desktop.
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 "rubygems" | |
require "oauth" | |
# Set Your Own | |
config = { | |
:client_id => "SET_YOUR_OWN", # Client Credentials Identifier | |
:client_secret => "SET_YOUR_OWN" # Client Credentials Secret | |
} | |
# Generate OAuth Client | |
client = OAuth::Consumer.new( | |
config[:client_id], | |
config[:client_secret], | |
:site => "https://api.cybozulive.com", | |
:request_token_path => "/oauth/initiate", | |
:access_token_path => "/oauth/token", | |
:authorize_path => "/oauth/authorize" | |
) | |
# Send Temporary Credentials Request | |
temporary_credentials = client.get_request_token( | |
:oauth_callback => "http://client.example.com" | |
) | |
sessions[:request_token_secret] | |
redirect_to temporary_credentials.authorize_url |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment