Restful Authentication plugin

Plugin details

Restful authentication generator has been taken from acts as authenticated to provide a login system using restful controllers.

Websitehttp://weblog.techno-weenie.net/2006/8/1/restful-authentication-plugin Repositoryhttp://svn.techno-weenie.net/projects/plugins/restful_authentication/ Author Rick Olson Tags Login, UserManagement LicenseMIT

Documentation

Install the plugin:
ruby script/plugin install http://svn.techno-weenie.net/projects/plugins/restful_authentication/

To use:

  ./script/generate authenticated user sessions \
		--include-activation \
		--stateful



The first parameter specifies the model that gets created in signup (typically a user or account model). A model with migration is created, as well as a basic controller with the create method.

The second parameter specifies the sessions controller name. This is the controller that handles the actual login/logout function on the site.

The third parameter (--include-activation) generates the code for a ActionMailer and its respective Activation Code through email.

The fourth (--stateful) builds in support for acts_as_state_machineand generates activation code. This was taken from:
http://www.vaporbase.com/postings/stateful_authentication

You can pass --skip-migration to skip the user migration.

If you're using acts_as_state_machine, define your users resource like this:

map.resources :users, :member => { :suspend   => :put,
                                     :unsuspend => :put,
                                     :purge     => :delete }



Also, add an observer to config/environment.rb if you chose the

--include-activation option



config.active_record.observers = :user_observer # or whatever you named you model

Further Documentation

Edit plugin | Back in time (1 older version) | Last edited by: scott, 2 months ago