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 (
Run the following if you haven't already:
gem sources -a http://gems.github.com
Install the gem(s):
sudo gem install danwrong-merb_openid
commit 9c17da9b7dfcf2f656221c4cea1c31267a35a1eb
tree 3d55c49440fa0342b218f7f91f07edc5091b41a6
parent aee51b8097718575e2c310a50e7237fbfc948188
tree 3d55c49440fa0342b218f7f91f07edc5091b41a6
parent aee51b8097718575e2c310a50e7237fbfc948188
| name | age | message | |
|---|---|---|---|
| |
LICENSE | Sun Jun 22 16:36:42 -0700 2008 | [danwrong] |
| |
README | Wed Jun 25 08:50:42 -0700 2008 | [danwrong] |
| |
Rakefile | Wed Jun 25 08:20:16 -0700 2008 | [danwrong] |
| |
lib/ | Wed Dec 03 14:44:53 -0800 2008 | [rlivsey] |
| |
merb_openid.gemspec | Sun Sep 28 00:32:21 -0700 2008 | [danwrong] |
| |
spec/ | Mon Jun 23 09:42:07 -0700 2008 | [danwrong] |
README
merb_openid =========== A plugin for Merb that wraps the ruby-openid gem (2.x) and provides an easy interface for consuming OpenIDs in a very similar way to the open_id_authentication plugin for Rails. Installation ============ Easy: gem install danwrong-merb_openid --source http://gems.github.com Then in your application's init.rb: dependency 'merb_openid' The plugin uses the pretty limited memory store by default but you can add a new store using Merb::Config: Merb::Config[:merb_openid][:store] = OpenID::Store::Memory.new You'll probably want to use a database store on production apps. I'll start adding adapters based on the various ORMs soon. Usage ===== In your routes you need to make sure that the url you consume OpenIDs from can accept get requests, so: r.match('openid').(:controller => 'session', :action => 'openid') Then in your controller: class Session < Merb::Controller def openid if openid_request? # has the user provided a url (openid_url) openid_authenticate do |result, identity_url| if result == :success user = User.find_by_openid_url(identity_url) end end end end end SReg ==== Getting SReg data is easy too: class Session < Merb::Controller def openid if openid_request? # has the user provided a url (openid_url) openid_authenticate(:fields => [:fullname, :email]) do |result, identity_url, sreg| if result == :success user = User.find_by_openid_url(identity_url) user.name = sreg[:fullname] end end end end end More to come!





