How do I configure OAuth to work with in development and production environments?

AtomicBroadcast
@AtomicBroadcast Andrew Dixon

Warning: I'm a total noob so please point me to any documentation that I might have missed. Thanks!

I registered an app with twitter and set my callback url to:

http://www.sendack.com:3000/auth/twitter/callback

and I can happily log in from my dev machine. But, now I want to push to a production environment - heroku - and I'm getting a 500 internal server error. I think this is because the above callback makes no sense in this production environment. So, does anyone know how to configure a twitter app so that it will work in both production and development?

Thanks again!

2 years 20 weeks ago

Replies

AtomicBroadcast
@AtomicBroadcast Andrew Dixon

Ug. I figured this out 30 seconds after submitting this question. The problem was that I didn't migrate the database on heroku.

$ heroku run rake db:setup

and all is well.

2 years 20 weeks ago
OCanCeylan
@OCanCeylan Orhan Can Ceylan

Hi !

I have a similar problem. I can post tweets while working on localhost, however when I'm in heroku, I have "Twitter::Error::BadRequest (Bad Authentication data):" from heroku logs.
Should I change my callback_url ? Or sth else ?

Thanks.

1 year 22 weeks ago