Skip to content

Instantly share code, notes, and snippets.

@nov
Created September 19, 2010 01:46
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save nov/586267 to your computer and use it in GitHub Desktop.
Save nov/586267 to your computer and use it in GitHub Desktop.
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