Note that there are some explanatory texts on larger screens.

plurals
  1. PO401 error with Ruby OAuth for Twitter
    text
    copied!<p>xI've been working for days to get Twitter to authenticate with Ruby, but I'm not having any luck.</p> <p>My first attempt was something like this:</p> <pre><code>class TwitterController &lt; ApplicationController def index @callback_url = "http://dev.twipler.com:3000/twitter/auth" @auth= TwitterOAuth::Client.new( :consumer_key =&gt; "xxx", :consumer_secret =&gt; "xxxxxxxxxxxxxxxxx" ) @rtoken = @auth.request_token :oauth_callback =&gt; @callback_url @token = @rtoken.token @secret = @rtoken.secret @link = @rtoken.authorize_url session['token' ] = @token session['secret'] = @secret redirect_to @link end def auth @auth.authorize_from_request(session[:rtoken], session[:rsecret], params[:oauth_verifier]) end end </code></pre> <p>And a very similar way but with the Twitter gem, and the same with the OAuth gem directly. No matter what OAuth::Consumer::token_request dies with a 401 error.</p> <p>So, out of desperation I attempted to git clone <a href="http://github.com/moomerman/sinitter" rel="nofollow noreferrer" title="snitter">Snitter</a>, add my Twitter creds, and try it, but it too dies with a 401.</p> <p>I've tried using localhost:300/twitter/auth, <a href="http://dev.twipler.com:3000/twitter/auth" rel="nofollow noreferrer">http://dev.twipler.com:3000/twitter/auth</a>, and a bit.ly for each of the former 2. Nothing works.</p> <p>Any help?</p> <p>EDIT: Of course I would forget to do the most logical thing to do and delete my secrets. (They've been changed ;)).</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload