Oauth for Twitter. difference between client and web application
I was able to get the oauth process to work for checking the PIN type. My Twitter app is a client type. When you enter url authorization into a web browser and grant access to the app, I have to enter a PIN in my ruby app. Can I finish the process of getting an access token without binding?
- What changes do I need to make for it to work without output?
- Can anyone tell me what makes the client and web application different in general? I would say it is the same when I receive an access token.
My current code is similar.
gem 'oauth'
require 'oauth/consumer'
consumer_key = 'your_key'
consumer_secret ='your_secret'
consumer=OAuth::Consumer.new consumer_key,
consumer_secret,
{:site=>"http://twitter.com"}
request_token = consumer.get_request_token
puts request_token.authorize_url
puts "Hit enter when you have completed authorization."
pin = STDIN.readline.chomp
access_token = request_token.get_access_token(:oauth_verifier => pin)
puts
puts access_token.token
puts access_token.secret
source to share
You cannot miss a PIN (called a verifier ).
This is when the client allows your application to access protected resources.
You can save your users the trouble of copying this number and pasting it into your application if you can host a public web application that provides a URL where the OAuth provider can redirect you using a verifier or PIN as a querystring parameter.
To do this, you must pass this URL in a parameter oauth_callback
instead of submittingoob
Edit:
You can check the relevant part of the spec -> 6.2.3
source to share