Skip to content

Instantly share code, notes, and snippets.

@jdjkelly
Created January 24, 2013 02:17
Show Gist options
  • Save jdjkelly/4617102 to your computer and use it in GitHub Desktop.
Save jdjkelly/4617102 to your computer and use it in GitHub Desktop.
Demonstrates how to make an OAuthd signed request to an endpoint by recreating the consumer via an OmniAuth strategy.
consumer = OmniAuth::Strategies::Yahoo.new(nil, consumer_key, consumer_secret).consumer
request_token = OAuth::RequestToken.new(consumer, token, secret )
token = OAuth::Token.new(token, secret )
access_token = request_token.get_access_token(:oauth_session_handle => self.session_handle, :token => token)
# Example OAuth signed API endpoint GET request
api_request = "http://social.yahooapis.com/v1/user/#{guid}/contacts"
response = access_token.get(api_request)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment