开发者

omniauth w/ Twitter not working on rails 3.1.0.rc5

I have a Rails app running on 3.1.0.rc5, and I've setup omniauth for twitter exactly the same as seen here (https://github.com/sferik/sign-in-with-twitter) but it's still not working.

The problem is that after Twitter is redirecting back to my callback URL I have request.env["omniauth.auth"] is nil, rack.auth is nil too. I even went so far as to print out the entire request.env hash and didn't see anything like access_token or access_secret.

The only thing that doesn't look like my re开发者_开发问答quest token and secret is stored in action_dispatch.secret_token.

Any ideas on how to make this work?


Ok, so I got this working now. My Gemfile was:

gem "oa-oauth", :require => "omniauth/oauth"
gem "twitter"

I changed it to:

gem 'omniauth', :git => 'git://github.com/intridea/omniauth.git'
gem 'twitter'
gem 'json_pure' 
gem 'json'

And everything started working. The request.env["omniauth.auth"] key was present etc. I had to add the json gem lines because of a uninitialized constant JSON::ParserError error I was getting. I think that is a bug in the release candidate.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜