This repository is private.
All pages are served over SSL and all pushing and pulling is done over SSH.
No one may fork, clone, or view it unless they are added as a member.
Every repository with this icon (
) is private.
Every repository with this icon (
This repository is public.
Anyone may fork, clone, or view it.
Every repository with this icon (
) is public.
Every repository with this icon (
| name | age | message | |
|---|---|---|---|
| |
MIT-LICENSE | Wed Jun 17 14:20:35 -0700 2009 | |
| |
README | Wed Jul 08 13:14:19 -0700 2009 | |
| |
Rakefile | Wed Jun 17 14:20:35 -0700 2009 | |
| |
generators/ | Sat Jun 20 08:59:28 -0700 2009 | |
| |
install.rb | Wed Jun 17 14:20:35 -0700 2009 | |
| |
lib/ | Wed Jun 17 14:20:35 -0700 2009 |
README
Twitter Authentication
This is a "Sign in with Twitter"-oauth authorization generator for rails, based
closely on the restful_authentication plugin by Rick Olson which can be found at
http://github.com/technoweenie/restful-authentication/tree/master.
"Sign in with Twitter" is the pattern of authentication that allows users to
connect their Twitter account with third-party services in as little as one
click.
Step 1 - Installation:
./script/plugin install git://github.com/corbanbrook/twitter_authentication.git
Step 2 - Generate Authentication System:
./script/generate twitter_authenticated user sessions
The first parameter specifies the model that bootstraps the twitter account
(typically a user or account model).
The second parameter specifies the sessions controller name. This is the
controller that handles the actual login/logout function on the site.
Step 3 - Migrate User Account Model
View the created migration and see if it meets your need. This model bootstaps
itself onto the users twitter account and caches all user details. Any additional
fields you require to store should be added to the migration at this time.
./rake db:migrate RAILS_ENV=development|production
Step 4 - Register Application with Twitter:
Visit http://twitter.com/oauth_clients/ and register a new application.
Point the Callback url to: http://your.application.url/sessions/callback
Upon completion you will receive a consumer key and secret you will need to
add to config/twitter_oauth.yml
Step 5 - Add Authentication to your Controllers
To add authentication to protect your controllers use a before_filter
ie.
before_filter :login_required
* Now your application should be ready to go? *
Requirements:
* Twitter gem by John NuneMaker http://twitter.rubyforge.org/
an API wrapper for Twitter and Twitter Search API's
gem install twitter
API
* login_required
Use on controllers to autheticate access to individual pages.
ie.
class UsersController < ApplicationController
before_filter :login_required, :except => 'index'
..
end
* authorized?, logged_in?
Show the logged in state of the user.
@corban weare.buildingsky.net
________________________________________________________________________________
Copyright (c) 2009 Corban Brook, released under the MIT license







