public
Description: master merb branch
Homepage: http://www.merbivore.com
Clone URL: git://github.com/wycats/merb.git
merb / merb-auth / merb-auth-more
name age message
..
file LICENSE Thu Oct 09 16:13:11 -0700 2008 Changes the Authentication to be namespaced und... [hassox]
file README.textile Fri Oct 17 15:08:11 -0700 2008 Part of a rebase [hassox]
file Rakefile Thu Sep 24 17:28:11 -0700 2009 Ripped out merb-actionorm Reverts: ffff732093d... [snusnu]
file TODO Fri Jan 18 11:25:19 -0800 2008 Leftover files [wycats]
directory lib/ Loading commit data...
directory spec/
merb-auth/merb-auth-more/README.textile

merb-auth-more
======

merb-auth-more provides stuff that’s useful, but not core to the functionality of
merb-auth. Strategies and “User” object mixins are here.

What Strategies are there?

Strategies are really simple to implement, but we’ve made some basic ones available.

The built in ones are basic but should be enough to get you going for most things.

To specify them, simply require them. For example,in Merb.root/merb/merb-auth/strategies.rb


Merb::Authentication.activate!(:default_password_form)
Merb::Authentication.activate!(:default_openid)

class MyApiLogin < ::Merb::Authentication::Strategy
  def run!
    # check for api login
  end
end

So far there are:

  • :default_password_form
  • :default_basic_auth
  • :default_openid

“User” mixins

To assist with your authenticating needs, there is user mixins available to enhance your user model
for basic cases. These really are just for the basic case, so if you need something extra you should
overwrite the methods, or implement your requirements.

To use these, require the specific mixin, and then include it into your “User” class.


  require 'merb-auth-more/mixins/salted_user'
  
  class User
    include Merb::Authentication::Mixins::SaltedUser
    
  end

The salted user mixin provides basic salted SHA1 password authentication. It implements the required User.authenticate method
for use with the default password strategies.