oauth process for twitter. the difference between client and web application

Posted by Radek on Stack Overflow See other posts from Stack Overflow or by Radek
Published on 2010-04-11T01:17:12Z Indexed on 2010/04/11 1:23 UTC
Read the original article Hit count: 392

Filed under:
|
|

I managed to make the oauth process work for PIN kind of verification. My twitter application is client type. When enter authorize url into web browser and grant the application access then I have to enter pin in my ruby application. Can I finish the process of getting access token without the pin thing?

My current code is like. What changes do I need to do to make it work without pin?

gem 'oauth'
require 'oauth/consumer'

consumer_key = 'w855B2MEJWQr0SoNDrnBKA'
consumer_secret ='yLK3Nk1xCWX30p07Id1ahxlXULOkucq5Rve28pNVwE'

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

© Stack Overflow or respective owner

Related posts about oauth

Related posts about ruby