views:

507

answers:

3

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

+2  A: 

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.

Hilbrand
thanks for your reply!But my app type is set to browser.any other suggestions appreciated.
I have no direct solution, but you could try to regenerate a new key, for your twitter app from the twitter side, or even register a new twitter application. But these are brute force solutions;-)
Hilbrand
A: 

Same thing is happening me - app is set as a browser but yet I get a pin when authenticating. Any solutions?

Lee
+1  A: 

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")
jaehyun