This repository is private.
All pages are served over SSL and all pushing and pulling is done over SSH.
No one may fork, clone, or view it unless they are added as a member.
Every repository with this icon (
) is private.
Every repository with this icon (
This repository is public.
Anyone may fork, clone, or view it.
Every repository with this icon (
) is public.
Every repository with this icon (
| name | age | message | |
|---|---|---|---|
| |
.gitignore | Sun May 24 23:33:09 -0700 2009 | |
| |
History.txt | Sat Feb 21 03:22:49 -0800 2009 | |
| |
Manifest.txt | Wed Feb 18 14:47:28 -0800 2009 | |
| |
README.txt | Fri Feb 20 01:50:42 -0800 2009 | |
| |
Rakefile | Mon Feb 16 00:21:39 -0800 2009 | |
| |
bin/ | Thu Jan 22 11:52:29 -0800 2009 | |
| |
casablanca.gemspec | Sat Feb 21 03:22:49 -0800 2009 | |
| |
init.rb | Sun Jan 25 07:14:59 -0800 2009 | |
| |
lib/ | Sat Feb 28 05:10:12 -0800 2009 | |
| |
test/ | Sat Feb 28 05:10:12 -0800 2009 |
README.txt
= Casablanca * http://rubyforge.org/projects/casablanca/ == DESCRIPTION: Casablanca is a ruby single sign-on client for the CAS 2.0 protocol. == FEATURES: * Includes a commandline Client to test getting service tickets from a CAS server * It can be run as a Rails plugin * Supports gatewaying and renewing == TODO: * Implement proxying * Check for single signout == SYNOPSIS: === Commandline: % casablanca In IRB: require 'casablanca' C = Casablanca::CommandLineClient.new({ :cas_server_url => "http://localhost:4567", :service_url => "http://localhost:3000" }) ticket = C.get_service_ticket('admin', 'admin') C.authenticate_ticket(ticket) === Rails: Configure your Cas server url in environment.rb: Casablanca::Rails::Config.config do |config| config[:cas_server_url] = "http://localhost:4567" end Add filters to the protected controllers. For most cases you would want the default filter: before_filter Casablanca::Rails::Filter If you want users without credentials to view the page as well use the Gateway filter before_filter Casablanca::Rails::GatewayFilter If you want users to always require new credentials for authentication use the renew filter before_filter Casablanca::Rails::RenewFilter Add something like the following to application.rb to get the current user from the Cas session: def current_user if session[:cas_user] && @user.nil? @user = User.find_by_name(session[:cas_user]) logout_killing_session! unless @user end @user end Your logout action could look like: def logout Casablanca::Rails::Filter.logout(self) redirect_to Casablanca::RailsFilter.logout_url(self) end == REQUIREMENTS: == INSTALL: Stable version * sudo gem install casablanca Development version * gem sources -a http://gems.github.com; sudo gem install p8-casablanca == LICENSE: (The MIT License) Copyright (c) 2009 Petrik de Heus Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the 'Software'), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.







