rmm5t / twitter-auth forked from mbleigh/twitter-auth

Standard authentication stack for Rails using Twitter to log in.

This URL has Read+Write access

name age message
file .gitignore Fri Feb 06 12:43:57 -0800 2009 Initial commit to twitter-auth. [mbleigh]
file LICENSE Fri Feb 06 12:43:57 -0800 2009 Initial commit to twitter-auth. [mbleigh]
file README.markdown Sat Feb 07 02:43:27 -0800 2009 Updating README. [mbleigh]
file Rakefile Fri Feb 06 12:50:03 -0800 2009 Fixing some jeweler things. [mbleigh]
file VERSION.yml Sat Feb 07 02:39:16 -0800 2009 Version bump to 0.0.2 [mbleigh]
directory app/ Sat Feb 07 02:38:57 -0800 2009 Moved User to a GenericUser and added an inheri... [mbleigh]
directory config/ Fri Feb 06 12:48:12 -0800 2009 First real commit to TwitterAuth. [mbleigh]
directory generators/ Sat Feb 07 02:38:57 -0800 2009 Moved User to a GenericUser and added an inheri... [mbleigh]
file init.rb Fri Feb 06 12:48:12 -0800 2009 First real commit to TwitterAuth. [mbleigh]
directory lib/ Fri Feb 06 19:15:08 -0800 2009 Moved login form to partial, fixed up encryptio... [mbleigh]
directory rails/ Fri Feb 06 20:23:25 -0800 2009 Switched to twitter gem, twitter4r is pretty us... [mbleigh]
directory spec/ Fri Feb 06 12:48:12 -0800 2009 First real commit to TwitterAuth. [mbleigh]
directory tasks/ Fri Feb 06 12:48:12 -0800 2009 First real commit to TwitterAuth. [mbleigh]
file twitter-auth.gemspec Sat Feb 07 02:39:26 -0800 2009 Regenerated gemspec for version 0.0.2 [mbleigh]
file uninstall.rb Fri Feb 06 12:48:12 -0800 2009 First real commit to TwitterAuth. [mbleigh]
README.markdown

TwitterAuth

TwitterAuth is a plugin to provide a standard authentication stack using Twitter as an SSO provider. This is obviously most useful and therefore targeted at apps that intend to heavily use the Twitter API.

Note: TwitterAuth uses Rails Engines functionality from Rails 2.3 and is therefore incompatible with earlier versions of Rails.

Getting Started

First, install either by gem or by plugin:

config.gem 'mbleigh-twitter-auth', :source => 'http://gems.github.com/'

OR

script/plugin install git://github.com/mbleigh/twitter-auth.git

Next, to get started, you will need to generate the migration and model that TwitterAuth uses for its User. It's simple:

script/generate migration twitter_auth

If you look in the migration you will see that there are some information fields pre-populated (name, location, etc). These will automatically be retrieved from Twitter at each login and therefor kept both accessible and fresh for your usage. If you remove any of these fields they will be ignored when the Twitter profile is pulled down.

Believe it or not, that's it! You now have access to the standard suite of restful-auth controller helpers such as:

  • login_required
  • current_user
  • logged_in?

And you also have the ability to login through the built-in SessionController. Just run the app and point your browser to '/login' to get started! You don't need to sign up because it will automatically create new users if the logging in user has never logged in before.

Caveats

This is extremely alpha code and has not been thoroughly spec'ed or even inspected. Use at your own risk as the functionality is likely to change drastically even in the near future.

Copyright (c) 2009 Michael Bleigh and Intridea, Inc., released under the MIT license