You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Sameer S edited this page Jan 4, 2016
·
3 revisions
When implementing the Web Flow, especially if you are doing this as a web app, you will need to set the oAuth verifier value to convert your request token into an access token, in a separate web HTTP call from the initial authorization step. So the request token object created in the first step is now lost.
To accomplish this, you have to recreate the request token. Therefore in the first step when generating the redirects to the oAuth provider (say, Twitter), store the request token in your persistent store.
Now, use this request token, and add the oauth_verifier option to the get_access_token method call available on the Oauth Consumer:
# The verifier will be in your callback URL, which you will see in the browser.
verifier = 'j0Ubj1fEj12QtlQ12AFBB'
# Create a consumer object via OAuth::Consumer.new()
req_token = YAML.load(db_model.load_appropriate_req_token())
consumer_obj.get_access_token req_token, oauth_verifier: verifier