I am new to Rails and I am trying to use omniauth with rails 2.3.8. I couldn't find any tutorial for this version of rails so I referred to http://blog.railsrumble.com/blog/2010/10/08/intridea-omniauth.
I added the initializer as follows:
OmniAuth::Strategies::Twitter = {
:consumer_key => 'xxxxxx',
:consumer_secret => 'xxxxxx'
}
After this step if I try to hit the URL '/auth/twitter' then I get "No route matches "/auth/twitter" with {:method=>:get}".
Has anyone used omniauth with rails 2.3.8?
OmniOauth is a Rack::Middleware. So you need use it like that.
So you need add like that :
ActionController::Dispatcher.middleware.use OmniAuth::Strategies::Twitter = {
:consumer_key => 'xxxxxx',
:consumer_secret => 'xxxxxx'
}
This is how it works for me in rails 2.3.8
omniauth.rb:
ActionController::Dispatcher.middleware.use OmniAuth::Builder do
provider :facebook,
"key", "secret",
:scope => %(email user_birthday publish_stream offline_access),
:client_options => {:ssl => {:ca_path => '/etc/ssl/certs'}}
end
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With