Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Rack middleware to acquire authentication information from a WebAuth system.

branch: master

Fetching latest commit…

Octocat-spinner-32-eaf2f5

Cannot retrieve the latest commit at this time

Octocat-spinner-32 examples
Octocat-spinner-32 lib
Octocat-spinner-32 spec
Octocat-spinner-32 .gitignore
Octocat-spinner-32 COPYING
Octocat-spinner-32 COPYING.LESSER
Octocat-spinner-32 Gemfile
Octocat-spinner-32 README.textile
Octocat-spinner-32 rack-webauth.gemspec
README.textile

Rack::Webauth

Rack middleware to acquire authentication information from a Stanford WebAuth system.

Documentation

Is available from here.

Usage in any rack based app:

  # In a rack environment:
  use(Rack::Webauth)

  # In a view or controller:
  include(Rack::Webauth::Helpers)

  # In a before filter or helper
  # or other middleware:
  @current_user = User.find_by_login(webauth.login)

  # or whatever...

Usage in rails:

  # config/application.rb:
    require 'rack-webauth'
    config.middleware.use(Rack::Webauth)

  # ApplicationController:
    include(Rack::Webauth::Helpers)
    # optionally:
    delegate :logged_in?, :to => :webauth

WebAuthOptional

If you want to make your site publicly available, but still enable WebAuth and have that information
in your Rails application, you need a patch to WebAuth. It is available from here. Also see the corresponding thread for more information.

License Information

Copyright © 2011 Niklas E. Cathor

rack-webauth is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as
published by the Free Software Foundation, either version 3 of
the License, or (at your option) any later version.

rack-webauth is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Lesser General Public License for more details.

You should have received a copy of the GNU Lesser General Public
License along with rack-webauth. If not, see www.gnu.org/licenses

Something went wrong with that request. Please try again.