Twitter Oauth Strategy with Warden + Devise Authentication Gems for Ruby
- by Michael Waxman
Devise, the authentication gem for Ruby based on Warden (another auth gem) does not support Twitter Oauth as an authentication strategy, BUT Warden does. There is a way to use the Warden Twitter Oauth strategy within Devise, but I cannot figure it out. I'm using the following block in the devise config file:
config.warden do |manager|
manager.oauth(:twitter) do |twitter|
twitter.consumer_secret = <SECRET>
twitter.consumer_key = <KEY>
twitter.options :site => 'http://twitter.com'
end
manager.default_strategies.unshift :twitter_oauth
end
But I keep on getting all sorts of error messages. Does anyone know how to make this work? I'm assuming there is more to do here (configuring a new link/route to talk to Warden, maybe adding attributes to the Devise User model, etc.), but I can't figure out what they are. Please help.