开发者

sign-in-with-twitter is not working on Heroku - Rails 3.1

I am using the oa-auth and twitter gem, via this example: https://github.com/sferik/sign-in-with-twitter

When I try to sign in with the button, this is what I see in my logs on Heroku, even though this works perfectly in development:

Started GET "/assets/sign-in-with-twitter-56f86819ac755692904d912373db060b.png" for XX.XX.XXX.XX3 at 2011-10-06 10:27:32 -0700
2011-10-06T17:27:32+00:00 app[web.1]: cache: [GET /assets/sign-in-with-twitter-56f86819ac755692904d912373db060b.png] miss, store
2011-10-06T17:27:32+00:00 heroku[router]: GET domain.heroku.com/assets/sign-in-with-twitter-56f86819ac755692904d912373db060b.png dyno=web.1 queue=0 wait=0ms service=21ms status=200 bytes=2490
2011-10-06T17:27:32+00:00 heroku[nginx]: xx.xx.xxx.xx - - [06/Oct/2011:10:27:32 -0700] "GET /assets/sign-in-with-twitter-56f86819ac755692904d912373db060b.png HTTP/1.1" 200 2490 "http://domain.heroku.com/" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_7_1) AppleWebKit/535.1 (KHTML, like Gecko) Chrome/14.0.835.186 Safari/535.1" mydomain.heroku.com
2011-10-06T17:27:56+00:00 app[web.1]: 
2011-10-06T17:27:56+00:00 app[web.1]: 
2011-10-06T17:27:56+00:00 app[web.1]: Started GET "/auth/twitter?utf8=%E2%9C%93&commit.x=171&commit.y=8&commit=Sign+in" for xx.xxx.xxx.xx at 2011-10-06 10:27:56 -0700
2011-10-06T17:27:56+00:00 app[web.1]: cache: [GET /auth/twitter?utf8=%E2%9C%93&commit.x=171&commit.y=8&commit=Sign+in] miss
2011-10-06T17:27:56+00:00 heroku[router]: GET mydomain.heroku.com/auth/twitter dyno=web.1 queue=0 wait=0ms service=370ms status=302 bytes=113
2011-10-06T17:27:56+00:00 heroku[nginx]: xx.xxx.xxx.xx - - [06/Oct/2011:10:27:56 -0700] "GET /auth/twitter?utf8=%E2%9C%93&commit.x=171&commit.y=8&commit=Sign+in HTTP/1.1" 302 113 "http://mydomain.heroku.com/" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_7_1) AppleWebKit/535.1 (KHTML, like Gecko) Chrome/14.0.835.186 Safari/535.1" mydomain.heroku.com
2011-10-06T17:27:57+00:00 app[web.1]: 
2011-10-06T17:27:57+00:00 app[web.1]: 
2011-10-06T17:27:57+00:00 app[web.1]: Started GET "/auth/twitter/callback?utf8=%E2%9C%93&commit.x=171&commit.y=8&commit=Sign+in&oauth_token=eiJ1oauth_verifier=JfqNp7P7lw5g" for xx.xxx.xxx.xx at 2011-10-06 10:27:57 -0700
2011-10-06T17:27:57+00:00 app[web.1]:   Processing by SessionsController#create as HTML
2011-10-06T17:27:57+00:00 app[web.1]:   Parameters: {"utf8"=>"✓", "commit.x"=>"171", "commit.y"=>"8", "commit"=>"Sign in", "oauth_token"=>"eiVMHybiNjtGOM13ytYTbgkI", "oauth_verifier"=>"JzX1BHjZVA4Z5EiFhq4mw5g"}
2011-10-06T17:27:59+00:00 app[web.1]: Completed 500 Internal Server Error in 1212ms
2011-10-06T17:27:59+00:00 app[web.1]: cache: [GET /auth/twitter/callback?utf8=%E2%9C%93&commit.x=171&commit.y=8&comm开发者_如何学Goit=Sign+in&oauth_token=VMHybiNjtGOM13ytYTbgkI&oauth_verifier=JfqNp7adsasdaf3245453462462462dmw5g] miss
2011-10-06T17:27:59+00:00 heroku[router]: GET mydomain.heroku.com/auth/twitter/callback dyno=web.1 queue=0 wait=0ms service=1992ms status=302 bytes=0
2011-10-06T17:27:59+00:00 heroku[nginx]: xx.xxx.xxx.xx - - [06/Oct/2011:10:27:59 -0700] "GET /auth/twitter/callback?utf8=%E2%9C%93&commit.x=171&commit.y=8&commit=Sign+in&oauth_token=eiJ1KQbgkI&oauth_verifier=Jq4mw5g HTTP/1.1" 302 0 "http://mydomain.heroku.com/" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_7_1) AppleWebKit/535.1 (KHTML, like Gecko) Chrome/14.0.835.186 Safari/535.1" mydomain.heroku.com
2011-10-06T17:27:59+00:00 app[web.1]: 
2011-10-06T17:27:59+00:00 app[web.1]: 
2011-10-06T17:27:59+00:00 app[web.1]: Started GET "/auth/failure?message=invalid_response" for xx.xxxx.xxx.x at 2011-10-06 10:27:59 -0700
2011-10-06T17:27:59+00:00 app[web.1]:   Processing by SessionsController#error as HTML
2011-10-06T17:27:59+00:00 app[web.1]:   Parameters: {"message"=>"invalid_response"}
2011-10-06T17:27:59+00:00 app[web.1]: Redirected to http://mydomain.heroku.com/
2011-10-06T17:27:59+00:00 app[web.1]: Completed 302 Found in 1ms
2011-10-06T17:27:59+00:00 app[web.1]: cache: [GET /auth/failure?message=invalid_response] miss
2011-10-06T17:27:59+00:00 heroku[router]: GET mydomain.com/auth/failure dyno=web.1 queue=0 wait=0ms service=31ms status=302 bytes=99
2011-10-06T17:27:59+00:00 heroku[nginx]: xx.xx.xxx.xx - - [06/Oct/2011:10:27:59 -0700] "GET /auth/failure?message=invalid_response HTTP/1.1" 302 99 "http://mydomain.heroku.com/" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_7_1) AppleWebKit/535.1 (KHTML, like Gecko) Chrome/14.0.835.186 Safari/535.1" mydomain.heroku.com

I already have everything configured and working in development, but the first time I pushed it to Heroku it doesn't work.

I also added my config vars to Heroku and that seems to be fine.

What should I do?

Thanks.


mydomain.heroku.com is not a valid application. Twitter needs a valid URL to callback to.


So it seems that there was something wrong in my code - specifically the create action of my sessions controller. It wasn't finding the user credentials once the auth credentials were returned.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜