Hello everyone, I am developing my Rails 3 application that uses Twitter OAuth and I am getting troubles because apparently I can't get the access_token, after clicking 'Allow' and Twitter redirecting me back to my application url, when I go to twitter.com/settings/connections I can't see my app there as authorized. I guess there is something wrong in my controller, I hope you can point them:
class OauthController < ApplicationController
def start
request_token = client.get_request_token(:oauth_callback => 'http://localhost:3000')
session[:request_token] = request_token.token
session[:request_token_secret] = request_token.secret
redirect_to request_token.authorize_url
end
def callback
@access_token = client.get_access_token(:oauth_verifier => params[:oauth_verifier])
render :json => access_token_get('https://api.twitter.com/account/verify_credentials.json')
end
protected
def client
@consumer = OAuth::Consumer.new(
'key','secret',
:site => 'https://api.twitter.com',
:authorize_url => 'https://api.twitter.com/oauth/authorize',
:access_token_url => 'https://api.twitter.com/oauth/access_token'
)
end
end
Please help, tell me where is my mistake, thanks for the attention!
Rodrigo Alves Vieira.