Giter Site home page Giter Site logo

mylons / authlogic_radius Goto Github PK

View Code? Open in Web Editor NEW

This project forked from bwlang/authlogic_radius

0.0 1.0 1.0 21 KB

Extension of the Authlogic library to add RADIUS support

Home Page: http://github.com/bwlang/authlogic_radius

License: MIT License

Ruby 100.00%

authlogic_radius's Introduction

Authlogic RADIUS

This is a simple gem to allow authentication against a radius server

Mostly it is a duplication of authlogic_ldap, with a global replace of “ldap” with “radius”… with a few RADIUS specific bits.

This version is tested only with ruby 2.0 and Rail 3 and 4

Installation

1. Add fields to your database

class AddRadiusFields < ActiveRecord::Migration
  def self.up
    add_column :users, :radius_login, :string
    add_index :users, :radius_login

    change_column :users, :login, :string, :default => nil, :null => true
    change_column :users, :crypted_password, :string, :default => nil, :null => true
    change_column :users, :password_salt, :string, :default => nil, :null => true
  end

  def self.down
    remove_column :users, :radius_login

    [:login, :crypted_password, :password_salt].each do |field|
      User.all(:conditions => "#{field} is NULL").each { |user| user.update_attribute(field, "") if user.send(field).nil? }
      change_column :users, field, :string, :default => "", :null => false
    end
  end
end

2. Install authlogic_radius gem

 Add the gem to your environment's list of gems
     config.gem "authlogic_radius"
$ sudo rake gems:install

3. Update your views to use :radius_login and :radius_password

4. Add/update configuration in your UserSession model with the RADIUS details

class UserSession < Authlogic::Session::Base
  ...
  self.radius_host = "your.radius.server"
  self.radius_shared_secret = 'super-secret' #not the same as the user password...
  #optionally
  self.radius_port = 1812
  self.radius_timeout = 2
  self.auto_register = true
  self.auto_register_domain = nil #will create user objects with :email = radius_login@auto_register_domain
  self.auto_register_method = :method_in_user_model_that_configures_new_radius_user
  ...
end

authlogic_radius's People

Contributors

bwlang avatar mylons avatar

Watchers

 avatar

Forkers

jakemiller13

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.