Last active
December 11, 2015 16:08
-
-
Save jdjkelly/4625106 to your computer and use it in GitHub Desktop.
Demonstrates a strategy for refreshing an access token using an OmniAuth provider class inherited from OAuth2
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
client = OmniAuth::Strategies::Windowslive.new( nil, windowslive_app_id, windowslive_app_consumer_secret).client | |
@access_token = OAuth2::AccessToken.new(client, refresh_token) | |
@access_token.refresh! | |
# Example API endpoint request | |
api_request_url = "https://apis.live.net/v5.0/me/contacts" | |
access_token.request(:get, api_request_url) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment