mbleigh / twitter-auth

Standard authentication stack for Rails using Twitter to log in.
355 stars 48 forks source link

Support Sign-In with Twitter on OAuth 1.0a #15

Closed sordyl closed 14 years ago

sordyl commented 15 years ago

Some changes were made to the twitter oauth api very recently to support OAuth 1.0a see http://groups.google.com/group/twitter-development-talk/browse_thread/thread/472500cfe9e7cdb9

The symptom is that instead of being sent back to my oauth_callback url from twitter I am shown a PIN number.

The easiest way to resolve this is to edit the session_controller. 1) Make sure you have oauth 0.3.5 2) Add the oauth_callback url to the consumer.get_request_token call in session_controller.new @request_token = TwitterAuth.consumer.get_request_token(:oauth_callback => TwitterAuth.oauth_callback) 3) Add the oauth_verifier to get_access_token method in session_controller.oauth_callback @access_token = @request_token.get_access_token(:oauth_verifier => params[:oauth_verifier])

Obviously there are a few other changes needed for elegance but these are the minimum needed.