Giter Club home page Giter Club logo

devise_dacs_authenticatable's Introduction

devise_dacs_authenticatable

Written by Heath Robinson
Taking a lot of inspiration from devise_cas_authenticatable

devise_dacs_authenticatable is DACS single sign-on support for Devise applications. It acts as a replacement for database_authenticatable. It uses an existing cookie from DACS for authentication.

Requirements

  • Rails 2.3 or greater (works with 3.x versions as well)
  • Devise 1.0 or greater

Installation

gem install --pre devise_dacs_authenticatable

and in your config/environment.rb (on Rails 2.3):

config.gem 'devise', :version => '~> 1.0.6'
config.gem 'devise_dacs_authenticatable'

or Gemfile (Rails 3.x):

gem 'devise'
gem 'devise_dacs_authenticatable'

Setup

Once devise_dacs_authenticatable is installed, add the following to your user model:

devise :dacs_authenticatable

You can also add other modules such as token_authenticatable, trackable, etc. Please do not add database_authenticatable as this module is intended to replace it.

You'll also need to set up the database schema for this:

create_table :users do |t|
  t.string :dacs_username, :null => false
end

We also recommend putting a unique index on the username column:

add_index :users, :dacs_username, :unique => true

Finally, you'll need to add some configuration to your config/initializers/devise.rb in order to tell your app how to talk to your CAS server:

Devise.setup do |config|
  ...
  config.dacs_base_url = "https://cas.myorganization.com/cgi-bin/dacs"
  
  # By default, devise_cas_authenticatable will create users.  If you would rather
  # require user records to already exist locally before they can authenticate via
  # CAS, uncomment the following line.
  # config.cas_create_user = false
end

See also

TODO

  • Make it work
  • Move session controller from app into plugin
  • Move login flow changes from app into plugin
  • Figure out how to mock DACS so it can be tested

License

devise_dacs_authenticatable is released under the terms and conditions of the MIT license. See the LICENSE file for more information.

devise_dacs_authenticatable's People

Contributors

ubiquitousthey avatar

Watchers

 avatar James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.