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 (
commit 390ddd57de381f149314eaab4542acae8ddd0b91
tree 014559a1a8faf3d2b178ba9440f65f7defaa010d
parent 5385a2e51d7cc898f7d05577deb4806194350ad9
tree 014559a1a8faf3d2b178ba9440f65f7defaa010d
parent 5385a2e51d7cc898f7d05577deb4806194350ad9
| name | age | message | |
|---|---|---|---|
| |
.gitignore | Fri Sep 04 11:22:57 -0700 2009 | |
| |
README | Fri Sep 04 12:06:34 -0700 2009 | |
| |
Rakefile | Fri Sep 04 11:22:57 -0700 2009 | |
| |
app/ | Fri Sep 04 11:36:07 -0700 2009 | |
| |
config/ | Fri Sep 04 12:10:19 -0700 2009 | |
| |
doc/ | Fri Sep 04 11:22:57 -0700 2009 | |
| |
generators/ | Fri Sep 04 11:45:55 -0700 2009 | |
| |
init.rb | Fri Sep 04 11:36:07 -0700 2009 | |
| |
lib/ | Fri Sep 04 11:45:55 -0700 2009 | |
| |
log/ | Fri Sep 04 11:22:57 -0700 2009 | |
| |
public/ | Fri Sep 04 11:22:57 -0700 2009 | |
| |
test/ | Fri Sep 04 11:22:57 -0700 2009 |
README
Prerequisites ============= Provides a thin wrapper around the excellent ruby-openid gem from JanRan. Be sure to install that first: gem install ruby-openid To understand what OpenID is about and how it works, it helps to read the documentation for lib/openid/consumer.rb from that gem. The specification used is http://openid.net/specs/openid-authentication-2_0.html. First Steps =========== After installing this plugin, you need to: rake open_id_authentication:db:create Then, you need a default route: map.root :controller => 'welcome' Then, anywhere you want users to be authenticated in your controller, just do: before_filter :signin_required And you're done! Helpers ======= The following helpers are available in your controller and views: * current_user - returns the current authenticated user * signed_in? - tells you whether or not the current session is authenticated Routes ====== This engine adds a session resource to your routes, as well as two handy URLs, "/signin" and "/signout", which do what they sound like they should. Assumptions =========== This engine currently assumes the existence of a User model. I know, that's a little dumb, but as a first pass, it seems like a reasonable assumption. As such, the migration adds an identity_url to the users table. Also, it assumes you're treating your users as RESTful resources, so if you have validations on your user model, upon account creation, if the user model isn't valid, the user will be redirected to edit_user_url. I hope to get both of those assumptions moved to a yaml or something soon. Credits ======= This is actually mostly a repackaging/following of the steps from the actual open_id_authentication plugin, found here: http://github.com/rails/open_id_authentication/tree/master I didn't know anything about Rails engines until I heard a talk by Mike Perham, whose github profile you can find here: http://github.com/mperham







