Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Twitter API - oauth gem - not getting callback

Tags:

oauth

twitter

I redirect the user of my application to Twitter for oauth style authentication using my app's request_token. The user is able to enter username and password on Twitter's page BUT then, instead of calling back my application, Twitter displays a page

You've successfully granted access to MyAppName!

Simply return to MyAppName and enter the following PIN to complete the process. 123456

Why is this happening?

I have set the callback url in my app's settings.

Thanks

like image 386
user16455 Avatar asked Dec 01 '25 21:12

user16455


2 Answers

Same thing is happening me. I just find the solution.

You can put :oauth_callback parameter to get request token.

Note: Because latest oauth gem, changes made in create and callback method on 29/04/2010

Check this document. http://blog.brijeshshah.com/integrate-twitter-oauth-in-your-rails-application/comment-page-1/

@request_token = UsersController.consumer.get_request_token(:oauth_callback => "callback-url-of-your-twitter-app")
like image 161
Jaehyun Avatar answered Dec 04 '25 10:12

Jaehyun


When you get a PIN code it means the application is configured as Desktop Application, see http://apiwiki.twitter.com/Authentication. To change this go to the twitter application page: http://twitter.com/apps/, sign in with your twitter account for your application and in Edit Application Settings, change the Application Type to Browser.

like image 28
Hilbrand Bouwkamp Avatar answered Dec 04 '25 11:12

Hilbrand Bouwkamp



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!