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 (
Sam Schenkman-Moore (author)
Thu Oct 02 12:15:11 -0700 2008
| name | age | message | |
|---|---|---|---|
| |
.gitignore | Wed Jun 18 09:25:33 -0700 2008 | [Sam Schenkman-Moore] |
| |
MIT-LICENSE | Wed May 28 07:22:55 -0700 2008 | [Sam Schenkman-Moore] |
| |
README | Thu Sep 25 08:24:26 -0700 2008 | [Sam Schenkman-Moore] |
| |
Rakefile | Wed Apr 30 12:08:49 -0700 2008 | [Sam Schenkman-Moore] |
| |
generators/ | Fri Jun 20 11:47:17 -0700 2008 | [Sam Schenkman-Moore] |
| |
init.rb | Wed May 28 07:22:55 -0700 2008 | [Sam Schenkman-Moore] |
| |
install.rb | Wed Apr 30 12:08:49 -0700 2008 | [Sam Schenkman-Moore] |
| |
lib/ | Thu Oct 02 12:15:11 -0700 2008 | [Sam Schenkman-Moore] |
| |
tasks/ | Wed May 28 07:22:55 -0700 2008 | [Sam Schenkman-Moore] |
| |
test/ | Wed Apr 30 12:08:49 -0700 2008 | [Sam Schenkman-Moore] |
| |
uninstall.rb | Wed Apr 30 12:08:49 -0700 2008 | [Sam Schenkman-Moore] |
README
OpenidProviderPlugin ============ This is a plugin to aid me (and maybe others) in adding openid provider functionality to their sites. Much of the work is taken from or inspired by the JanRain openid library, the Apache Heraldy example, and also Dennis Blöte's masquerade. Oh yeah, and some fine poaching from the open_id_authentication plugin in Rails core. Requires the ruby-openid gem, and aasm. gem install ruby-openid gem install rubyist-aasm --source http://gems.github.com Example ======= class ApplicationController < ActionController::Base ... include OpenidServer ... end class UsersController include OpenidServerResource before_filter :openid_routing, :only => :show skip_before_filter :verify_authenticity_token protected def attempt_approval # Just after this method ends, the plugin will call "current_request.approved?". # Approved requests will be sent back to the relying party that originated them. # Non-approved requests with call "reconcile_non_approval", where you redirect to # a login page, or trust page. # example: if logged_in? and current_user == @user current_request.verify end if current_request.verified? and current_user.allows_openid_login current_request.approved end end def reconcile_non_approval case current_request.status when verified redirect_to manual_approval_path else redirect_to login_path end end end In a controller where you include OpenidServerResource the endpoint is assumed to be the resource requested. If you need to customize this (such as focusing on a given endpoint in a different controller) overwrite endpoint_url. Example ======= class TrustsController # ... protected def endpoint_url params[:endpoint_for_trust] or raise ErrorError end end You also need to adjust the routes so that POST requests to a given resource are accepted: Example ======= map.identity_endpoint 'identities/:id', :id => /.+/, :controller => 'identities', :action => 'show', :conditions => { :method => :post } map.resources :identities Copyright (c) 2008 Sam Schenkman-Moore, released under the MIT license




