TwitterAuth aims to provide a complete authentication and API access solution for creating Twitter applications in Rails. It provides a generator and all of the necessary components to use Twitter as the sole authentication provider for an application using either Twitter's OAuth or HTTP Basic authentication strategies.
You can include TwitterAuth as a gem in your project like so:
config.gem 'mbleigh-twitter-auth', :source => 'http://gems.github.com'
Or you can install it as a traditional Rails plugin:
script/plugin install git://github.com/mbleigh/twitter-auth.git
Note that because TwitterAuth utilizes Rails Engines functionality introduced in Rails 2.3, it will not work with earlier versions of Rails.
To utilize TwitterAuth in your application you will need to run the generator:
script/generate twitter_auth --strategy [oauth|basic]
This will generate a migration as well as set up the stubs needed to use the Rails Engines controllers and models set up by TwitterAuth. It will also create a User class that inherits from TwitterUser, abstracting away all of the Twitter authentication functionality and leaving you a blank slate to work with for your application.
There are a number of hooks to extend the functionality of TwitterAuth. Here is a brief description of each of them.
TwitterAuth provides some default controller methods that may be overridden in your
ApplicationController to behave differently.
authorization_failed(message): called when Twitter authorization has failed during the process. By default, simply redirects to the site root.
authorization_succeeded: called when Twitter authorization has completed successfully. By default, simply redirects to the site root.
TwitterAuth is not affiliated with Twitter, Inc.