Created
January 24, 2013 02:17
-
-
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.
This file contains hidden or 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
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