relevance-rubycas-server 0.6.99
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/.loadpath +5 -0
- data/.project +17 -0
- data/CHANGELOG.txt +1 -0
- data/History.txt +223 -0
- data/LICENSE.txt +504 -0
- data/Manifest.txt +61 -0
- data/README.txt +25 -0
- data/Rakefile +60 -0
- data/bin/rubycas-server +26 -0
- data/bin/rubycas-server-ctl +22 -0
- data/config.example.yml +363 -0
- data/custom_views.example.rb +11 -0
- data/lib/casserver.rb +110 -0
- data/lib/casserver/authenticators/active_directory_ldap.rb +11 -0
- data/lib/casserver/authenticators/base.rb +47 -0
- data/lib/casserver/authenticators/ldap.rb +108 -0
- data/lib/casserver/authenticators/ntlm.rb +88 -0
- data/lib/casserver/authenticators/sql.rb +102 -0
- data/lib/casserver/authenticators/sql_encrypted.rb +75 -0
- data/lib/casserver/authenticators/test.rb +15 -0
- data/lib/casserver/cas.rb +307 -0
- data/lib/casserver/conf.rb +112 -0
- data/lib/casserver/controllers.rb +436 -0
- data/lib/casserver/environment.rb +23 -0
- data/lib/casserver/models.rb +218 -0
- data/lib/casserver/postambles.rb +174 -0
- data/lib/casserver/utils.rb +30 -0
- data/lib/casserver/version.rb +9 -0
- data/lib/casserver/views.rb +235 -0
- data/lib/rubycas-server.rb +1 -0
- data/lib/rubycas-server/version.rb +1 -0
- data/lib/themes/cas.css +121 -0
- data/lib/themes/notice.png +0 -0
- data/lib/themes/ok.png +0 -0
- data/lib/themes/simple/bg.png +0 -0
- data/lib/themes/simple/login_box_bg.png +0 -0
- data/lib/themes/simple/logo.png +0 -0
- data/lib/themes/simple/theme.css +28 -0
- data/lib/themes/urbacon/bg.png +0 -0
- data/lib/themes/urbacon/login_box_bg.png +0 -0
- data/lib/themes/urbacon/logo.png +0 -0
- data/lib/themes/urbacon/theme.css +33 -0
- data/lib/themes/warning.png +0 -0
- data/misc/basic_cas_single_signon_mechanism_diagram.png +0 -0
- data/misc/basic_cas_single_signon_mechanism_diagram.svg +652 -0
- data/resources/init.d.sh +58 -0
- data/setup.rb +1585 -0
- data/test/test_cas.rb +33 -0
- data/test/test_casserver.rb +125 -0
- data/vendor/isaac_0.9.1/LICENSE +26 -0
- data/vendor/isaac_0.9.1/README +78 -0
- data/vendor/isaac_0.9.1/TODO +3 -0
- data/vendor/isaac_0.9.1/VERSIONS +3 -0
- data/vendor/isaac_0.9.1/crypt/ISAAC.rb +171 -0
- data/vendor/isaac_0.9.1/isaac.gemspec +39 -0
- data/vendor/isaac_0.9.1/setup.rb +596 -0
- data/vendor/isaac_0.9.1/test/TC_ISAAC.rb +76 -0
- metadata +158 -0
data/Manifest.txt
ADDED
@@ -0,0 +1,61 @@
|
|
1
|
+
.loadpath
|
2
|
+
.project
|
3
|
+
CHANGELOG.txt
|
4
|
+
History.txt
|
5
|
+
LICENSE.txt
|
6
|
+
Manifest.txt
|
7
|
+
README.txt
|
8
|
+
Rakefile
|
9
|
+
bin/rubycas-server
|
10
|
+
bin/rubycas-server-ctl
|
11
|
+
casserver.db
|
12
|
+
casserver.log
|
13
|
+
casserver_db.log
|
14
|
+
config.example.yml
|
15
|
+
custom_views.example.rb
|
16
|
+
lib/casserver.rb
|
17
|
+
lib/casserver/authenticators/active_directory_ldap.rb
|
18
|
+
lib/casserver/authenticators/base.rb
|
19
|
+
lib/casserver/authenticators/ldap.rb
|
20
|
+
lib/casserver/authenticators/ntlm.rb
|
21
|
+
lib/casserver/authenticators/sql.rb
|
22
|
+
lib/casserver/authenticators/sql_encrypted.rb
|
23
|
+
lib/casserver/authenticators/test.rb
|
24
|
+
lib/casserver/cas.rb
|
25
|
+
lib/casserver/conf.rb
|
26
|
+
lib/casserver/controllers.rb
|
27
|
+
lib/casserver/environment.rb
|
28
|
+
lib/casserver/models.rb
|
29
|
+
lib/casserver/postambles.rb
|
30
|
+
lib/casserver/utils.rb
|
31
|
+
lib/casserver/version.rb
|
32
|
+
lib/casserver/views.rb
|
33
|
+
lib/rubycas-server.rb
|
34
|
+
lib/rubycas-server/version.rb
|
35
|
+
lib/themes/cas.css
|
36
|
+
lib/themes/notice.png
|
37
|
+
lib/themes/ok.png
|
38
|
+
lib/themes/simple/bg.png
|
39
|
+
lib/themes/simple/login_box_bg.png
|
40
|
+
lib/themes/simple/logo.png
|
41
|
+
lib/themes/simple/theme.css
|
42
|
+
lib/themes/urbacon/bg.png
|
43
|
+
lib/themes/urbacon/login_box_bg.png
|
44
|
+
lib/themes/urbacon/logo.png
|
45
|
+
lib/themes/urbacon/theme.css
|
46
|
+
lib/themes/warning.png
|
47
|
+
misc/basic_cas_single_signon_mechanism_diagram.png
|
48
|
+
misc/basic_cas_single_signon_mechanism_diagram.svg
|
49
|
+
resources/init.d.sh
|
50
|
+
setup.rb
|
51
|
+
test/test.log
|
52
|
+
test/test_cas.rb
|
53
|
+
test/test_casserver.rb
|
54
|
+
vendor/isaac_0.9.1/LICENSE
|
55
|
+
vendor/isaac_0.9.1/README
|
56
|
+
vendor/isaac_0.9.1/TODO
|
57
|
+
vendor/isaac_0.9.1/VERSIONS
|
58
|
+
vendor/isaac_0.9.1/crypt/ISAAC.rb
|
59
|
+
vendor/isaac_0.9.1/isaac.gemspec
|
60
|
+
vendor/isaac_0.9.1/setup.rb
|
61
|
+
vendor/isaac_0.9.1/test/TC_ISAAC.rb
|
data/README.txt
ADDED
@@ -0,0 +1,25 @@
|
|
1
|
+
= RubyCAS-Server
|
2
|
+
|
3
|
+
*Copyright*:: 2008 Urbacon Ltd.
|
4
|
+
*Authors*:: Matt Zukowski <matt at roughest dot net>, Jason Zylks
|
5
|
+
*Homepage*:: http://rubycas-server.googlecode.com
|
6
|
+
|
7
|
+
For info and installation instructions please see http://code.google.com/p/rubycas-server
|
8
|
+
|
9
|
+
|
10
|
+
== License
|
11
|
+
|
12
|
+
RubyCAS-Server is free software; you can redistribute it and/or modify
|
13
|
+
it under the terms of the GNU Lesser General Public License as published
|
14
|
+
by the Free Software Foundation; either version 2 of the License, or
|
15
|
+
(at your option) any later version.
|
16
|
+
|
17
|
+
RubyCAS-Server is distributed in the hope that it will be useful,
|
18
|
+
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
19
|
+
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
20
|
+
GNU General Public License for more details.
|
21
|
+
|
22
|
+
You should have received a copy of the GNU Lesser General Public License
|
23
|
+
along with RubyCAS-Server; if not, write to the Free Software
|
24
|
+
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
25
|
+
|
data/Rakefile
ADDED
@@ -0,0 +1,60 @@
|
|
1
|
+
require 'rubygems'
|
2
|
+
require 'rake'
|
3
|
+
require 'rake/clean'
|
4
|
+
require 'rake/testtask'
|
5
|
+
require 'rake/packagetask'
|
6
|
+
require 'rake/gempackagetask'
|
7
|
+
require 'rake/rdoctask'
|
8
|
+
require 'rake/contrib/rubyforgepublisher'
|
9
|
+
require 'fileutils'
|
10
|
+
require 'hoe'
|
11
|
+
include FileUtils
|
12
|
+
require File.join(File.dirname(__FILE__), 'lib', 'casserver', 'version')
|
13
|
+
|
14
|
+
AUTHOR = ["Matt Zukowski", "Jason Zylks"] # can also be an array of Authors
|
15
|
+
EMAIL = ["matt at roughest dot net"]
|
16
|
+
DESCRIPTION = "Provides single sign on for web applications using the CAS protocol."
|
17
|
+
GEM_NAME = "rubycas-server" # what ppl will type to install your gem
|
18
|
+
RUBYFORGE_PROJECT = "rubycas-server" # The unix name for your project
|
19
|
+
HOMEPATH = "http://#{RUBYFORGE_PROJECT}.rubyforge.org"
|
20
|
+
|
21
|
+
DEPS = [
|
22
|
+
['activesupport', '>= 1.4.0'],
|
23
|
+
['activerecord', '>=1.15.3'],
|
24
|
+
['picnic', '>=0.6.4']
|
25
|
+
]
|
26
|
+
|
27
|
+
|
28
|
+
NAME = "rubycas-server"
|
29
|
+
#REV = nil
|
30
|
+
REV = `svn info`[/Revision: (\d+)/, 1] rescue nil
|
31
|
+
VERS = ENV['VERSION'] || (CASServer::VERSION::STRING + (REV ? ".#{REV}" : ""))
|
32
|
+
CLEAN.include ['**/.*.sw?', '*.gem', '.config']
|
33
|
+
RDOC_OPTS = ['--quiet', '--title', "RubyCAS-Server #{VERS} Documentation",
|
34
|
+
"--opname", "index.html",
|
35
|
+
"--line-numbers",
|
36
|
+
"--main", "README",
|
37
|
+
"--inline-source"]
|
38
|
+
|
39
|
+
class Hoe
|
40
|
+
def extra_deps
|
41
|
+
@extra_deps.reject { |x| Array(x).first == 'hoe' }
|
42
|
+
end
|
43
|
+
end
|
44
|
+
|
45
|
+
# Generate all the Rake tasks
|
46
|
+
# Run 'rake -T' to see list of generated tasks (from gem root directory)
|
47
|
+
hoe = Hoe.new(GEM_NAME, VERS) do |p|
|
48
|
+
p.author = AUTHOR
|
49
|
+
p.description = DESCRIPTION
|
50
|
+
p.email = EMAIL
|
51
|
+
p.summary = DESCRIPTION
|
52
|
+
p.url = HOMEPATH
|
53
|
+
p.rubyforge_name = RUBYFORGE_PROJECT if RUBYFORGE_PROJECT
|
54
|
+
p.test_globs = ["test/**/test_*.rb"]
|
55
|
+
p.clean_globs = CLEAN #An array of file patterns to delete on clean.
|
56
|
+
|
57
|
+
# == Optional
|
58
|
+
p.extra_deps = DEPS
|
59
|
+
p.spec_extras = {:executables => ['rubycas-server', 'rubycas-server-ctl']}
|
60
|
+
end
|
data/bin/rubycas-server
ADDED
@@ -0,0 +1,26 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
|
3
|
+
if File.exists?(picnic = File.expand_path(File.dirname(File.expand_path(__FILE__))+'/../vendor/picnic/lib'))
|
4
|
+
$: << picnic
|
5
|
+
elsif File.exists?(picnic = File.expand_path(File.dirname(File.expand_path(__FILE__))+'/../../picnic/lib'))
|
6
|
+
$: << picnic
|
7
|
+
else
|
8
|
+
require 'rubygems'
|
9
|
+
|
10
|
+
# make things backwards-compatible for rubygems < 0.9.0
|
11
|
+
unless Object.method_defined? :gem
|
12
|
+
alias gem require_gem
|
13
|
+
end
|
14
|
+
|
15
|
+
gem 'picnic'
|
16
|
+
end
|
17
|
+
|
18
|
+
require 'picnic/cli'
|
19
|
+
|
20
|
+
cli = Picnic::Cli.new(
|
21
|
+
'rubycas-server',
|
22
|
+
:app_path => File.expand_path(File.dirname(File.expand_path(__FILE__))),
|
23
|
+
:app_module => 'CASServer'
|
24
|
+
)
|
25
|
+
|
26
|
+
cli.handle_cli_input
|
@@ -0,0 +1,22 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
|
3
|
+
if File.exists?(picnic = File.expand_path(File.dirname(File.expand_path(__FILE__))+'/../vendor/picnic/lib'))
|
4
|
+
$: << picnic
|
5
|
+
elsif File.exists?(picnic = File.expand_path(File.dirname(File.expand_path(__FILE__))+'/../../picnic/lib'))
|
6
|
+
$: << picnic
|
7
|
+
else
|
8
|
+
require 'rubygems'
|
9
|
+
|
10
|
+
# make things backwards-compatible for rubygems < 0.9.0
|
11
|
+
unless Object.method_defined? :gem
|
12
|
+
alias gem require_gem
|
13
|
+
end
|
14
|
+
|
15
|
+
gem 'picnic'
|
16
|
+
end
|
17
|
+
|
18
|
+
require 'picnic/service_control'
|
19
|
+
|
20
|
+
ctl = Picnic::ServiceControl.new('rubycas-server')
|
21
|
+
|
22
|
+
ctl.handle_cli_input
|
data/config.example.yml
ADDED
@@ -0,0 +1,363 @@
|
|
1
|
+
# IMPORTANT NOTE ABOUT YAML CONFIGURATION FILES
|
2
|
+
# ---> Be sure to use spaces instead of tabs for indentation. YAML is
|
3
|
+
# white-space sensitive!
|
4
|
+
|
5
|
+
##### SERVER ###################################################################
|
6
|
+
|
7
|
+
# Under what environment are you running the CAS server? The following methods
|
8
|
+
# are currently supported:
|
9
|
+
#
|
10
|
+
# webrick -- run as a stand-alone webrick server; this is the default method
|
11
|
+
# mongrel -- run as a stand-alone mongrel server; fast, but you'll need to
|
12
|
+
# install mongrel and run it behind an https reverse proxy like Pound
|
13
|
+
# or Apache 2.2's mod_proxy)
|
14
|
+
# cgi -- slow, but simple to set up if you're already familliar with
|
15
|
+
# deploying CGI scripts
|
16
|
+
# fastcgi -- see http://www.fastcgi.com (e.g. under Apache you can use this with
|
17
|
+
# mod_fastcgi)
|
18
|
+
#
|
19
|
+
# The cgi and fastcgi methods have not been thoroughly tested!
|
20
|
+
# Please report any problems to the authors.
|
21
|
+
#
|
22
|
+
# IMPORTANT: If you use mongrel, you will need to run the server behind a
|
23
|
+
# reverse proxy (Pound, Apache 2.2 with mod_proxy, etc.) since
|
24
|
+
# mongrel does not support SSL/HTTPS. See the RubyCAS-Server install
|
25
|
+
# docs for more info.
|
26
|
+
|
27
|
+
### webrick example
|
28
|
+
|
29
|
+
server: webrick
|
30
|
+
port: 443
|
31
|
+
ssl_cert: /path/to/your/ssl.pem
|
32
|
+
|
33
|
+
# If private key is separate from cert
|
34
|
+
#ssl_key: /path/to/your/private_key.pem
|
35
|
+
|
36
|
+
# By default the login page will be available at the root path
|
37
|
+
# (e.g. https://example.foo/). The uri_path option lets you serve it from a
|
38
|
+
# different path (e.g. https://example.foo/cas).
|
39
|
+
#uri_path: /cas
|
40
|
+
|
41
|
+
# Bind the server to a specific address. Use 0.0.0.0 to listen on all
|
42
|
+
# available interfaces.
|
43
|
+
#bind_address: 0.0.0.0
|
44
|
+
|
45
|
+
### mongrel example (since mongrel doesn't support SSL on its own, you will have
|
46
|
+
### to run this behind an https reverse proxy)
|
47
|
+
|
48
|
+
#server: mongrel
|
49
|
+
#port: 110011
|
50
|
+
|
51
|
+
# By default the login page will be available at the root path
|
52
|
+
# (e.g. https://example.foo/). The uri_path option lets you serve it from a
|
53
|
+
# different path (e.g. https://example.foo/cas).
|
54
|
+
#uri_path: /cas
|
55
|
+
|
56
|
+
# Bind the server to a specific address. Use 0.0.0.0 to listen on all
|
57
|
+
# available interfaces.
|
58
|
+
#bind_address: 0.0.0.0
|
59
|
+
|
60
|
+
### cgi example (you'll need to serve this via an SSL-capable server like Apache)
|
61
|
+
|
62
|
+
#server: cgi
|
63
|
+
|
64
|
+
### fastcgi example (you'll need to serve this via an SSL-capable server like Apache)
|
65
|
+
|
66
|
+
#server: fastcgi
|
67
|
+
|
68
|
+
|
69
|
+
##### DATABASE #################################################################
|
70
|
+
|
71
|
+
# Set up the database connection. Make sure that this database is secure!
|
72
|
+
#
|
73
|
+
# By default, we use MySQL, since it is widely used and does not require any
|
74
|
+
# additional
|
75
|
+
# ruby libraries besides ActiveRecord.
|
76
|
+
#
|
77
|
+
# With MySQL, your config would be something like the following:
|
78
|
+
# (be sure to create the casserver database in MySQL beforehand,
|
79
|
+
# i.e. `mysqladmin -u root create casserver`)
|
80
|
+
|
81
|
+
database:
|
82
|
+
adapter: mysql
|
83
|
+
database: casserver
|
84
|
+
username: root
|
85
|
+
password:
|
86
|
+
host: localhost
|
87
|
+
|
88
|
+
#
|
89
|
+
# Instead of MySQL you can use SQLite3, PostgreSQL, MSSQL, or anything else
|
90
|
+
# supported by ActiveRecord.
|
91
|
+
#
|
92
|
+
# With SQLite3 (which does not require a separate database server), your
|
93
|
+
# configuration would look something like the following (don't forget to install
|
94
|
+
# the sqlite3-ruby gem beforehand!):
|
95
|
+
#
|
96
|
+
#database:
|
97
|
+
# adapter: sqlite3
|
98
|
+
# dbfile: /var/lib/casserver.db
|
99
|
+
|
100
|
+
|
101
|
+
##### AUTHENTICATION ###########################################################
|
102
|
+
|
103
|
+
# Configure how username/passwords are validated.
|
104
|
+
#
|
105
|
+
# !!! YOU MUST CONFIGURE ONE OF THESE AUTHENTICATION METHODS !!!
|
106
|
+
#
|
107
|
+
# Currently there are three built-in methods for authentication:
|
108
|
+
# SQL, ActiveDirectory, and LDAP. If none of these work for you, it is
|
109
|
+
# relatively easy to write your own custom Authenticator class.
|
110
|
+
#
|
111
|
+
# === SQL Authentication =======================================================
|
112
|
+
#
|
113
|
+
# The simplest method is to validate against a SQL database. This assumes
|
114
|
+
# that all of your users are stored in a table that has a 'username' column
|
115
|
+
# and a 'password' column. When the user logs in, CAS conects to this database
|
116
|
+
# and looks for a matching username/password in the users table. If a matching
|
117
|
+
# username and password is found, authentication is successful.
|
118
|
+
#
|
119
|
+
# If you prefer to have your passwords stored in an encrypted form, have a
|
120
|
+
# look at the SQLEncrypted authenticator:
|
121
|
+
# http://code.google.com/p/rubycas-server/wiki/UsingTheSQLEncryptedAuthenticator
|
122
|
+
#
|
123
|
+
# If your users table stores passwords with MD5 hashing (for example as with
|
124
|
+
# Drupal) try using the SQLMd5 version of the SQL authenticator.
|
125
|
+
#
|
126
|
+
# Example:
|
127
|
+
#
|
128
|
+
#authenticator:
|
129
|
+
# class: CASServer::Authenticators::SQL
|
130
|
+
# database:
|
131
|
+
# adapter: mysql
|
132
|
+
# database: some_database_with_users_table
|
133
|
+
# username: root
|
134
|
+
# password:
|
135
|
+
# server: localhost
|
136
|
+
# user_table: users
|
137
|
+
# username_column: username
|
138
|
+
# password_column: password
|
139
|
+
#
|
140
|
+
# When replying to a CAS client's validation request, the server will normally
|
141
|
+
# provide the client with the authenticated user's username. However it is now
|
142
|
+
# possible for the server to provide the client with additional attributes.
|
143
|
+
# You can configure the SQL authenticator to provide data from additional
|
144
|
+
# columns in the users table by listing the names of the columns under the
|
145
|
+
# 'extra_attributes' option. Note though that this functionality is experimental.
|
146
|
+
# It should work with RubyCAS-Client, but may or may not work with other CAS
|
147
|
+
# clients.
|
148
|
+
#
|
149
|
+
# For example, with this configuration, the 'full_name' and 'access_level'
|
150
|
+
# columns will be provided to your CAS clients along with the username:
|
151
|
+
#
|
152
|
+
#authenticator:
|
153
|
+
# class: CASServer::Authenticators::SQL
|
154
|
+
# database:
|
155
|
+
# adapter: mysql
|
156
|
+
# database: some_database_with_users_table
|
157
|
+
# user_table: users
|
158
|
+
# username_column: username
|
159
|
+
# password_column: password
|
160
|
+
# extra_attributes: full_name, access_level
|
161
|
+
#
|
162
|
+
#
|
163
|
+
# === ActiveDirectory Authentication ===========================================
|
164
|
+
#
|
165
|
+
# This method authenticates against Microsoft's Active Directory using LDAP.
|
166
|
+
# You must enter your ActiveDirectory server, and base DN. The port number
|
167
|
+
# and LDAP filter are optional. You must also enter a CN and password
|
168
|
+
# for an "authenticator" user. The authenticator users this account to
|
169
|
+
# log in to the ActiveDirectory server and search LDAP. This does not have
|
170
|
+
# to be an administrative account -- it only has to be able to search for other
|
171
|
+
# users.
|
172
|
+
#
|
173
|
+
# Note that the auth_user parameter must be the user's CN (Common Name)!
|
174
|
+
# In Active Directory, the CN is genarally the user's full name, which is not
|
175
|
+
# the same as their username (sAMAccountName).
|
176
|
+
#
|
177
|
+
#authenticator:
|
178
|
+
# class: CASServer::Authenticators::ActiveDirectoryLDAP
|
179
|
+
# ldap:
|
180
|
+
# server: ad.example.net
|
181
|
+
# port: 389
|
182
|
+
# base: dc=example,dc=net
|
183
|
+
# filter: (objectClass=person)
|
184
|
+
# auth_user: authenticator
|
185
|
+
# auth_password: itsasecret
|
186
|
+
#
|
187
|
+
# It is possible to authenticate against Active Directory without the
|
188
|
+
# authenticator user, but this requires that users type in their CN as
|
189
|
+
# the username rather than typing in their sAMAccountName. In other words
|
190
|
+
# users will likely have to authenticate by typing their full name,
|
191
|
+
# rather than their username. If you prefer to do this, then just
|
192
|
+
# omit the auth_user and auth_password values in the above example.
|
193
|
+
#
|
194
|
+
#
|
195
|
+
# === LDAP Authentication ======================================================
|
196
|
+
#
|
197
|
+
# This is a more general version of the ActiveDirectory authenticator.
|
198
|
+
# The configuration is similar, except you don't need an authenticator
|
199
|
+
# username or password. Note that this authenticator hasn't been widely
|
200
|
+
# tested, so it is not guaranteed to work.
|
201
|
+
#=====
|
202
|
+
#authenticator:
|
203
|
+
# class: CASServer::Authenticators::ActiveDirectoryLDAP
|
204
|
+
# ldap:
|
205
|
+
# server: ad.example.net
|
206
|
+
# port: 389
|
207
|
+
# base: dc=example,dc=net
|
208
|
+
# filter: (objectClass=person)
|
209
|
+
#
|
210
|
+
#
|
211
|
+
# === Custom Authentication ====================================================
|
212
|
+
#
|
213
|
+
# It should be relatively easy to write your own Authenticator class. Have a look
|
214
|
+
# at the built-in authenticators in the casserver/authenticators directory. Your
|
215
|
+
# authenticator should extend the CASServer::Authenticators::Base class and must
|
216
|
+
# implement a validate() method that takes a single hash argument. When the user
|
217
|
+
# submits the login form, the username and password they entered is passed to
|
218
|
+
# validate() as a hash under :username and :password keys. In the future, this
|
219
|
+
# hash might also contain other data such as the domain that the user is logging
|
220
|
+
# in to.
|
221
|
+
#
|
222
|
+
# To use your custom authenticator, specify it's class name and path to the
|
223
|
+
# source file in the authenticator section of the config. Any other parameters
|
224
|
+
# you specify in the authenticator configuration will be passed on to the
|
225
|
+
# authenticator and made availabe in the validate() method as an @options hash.
|
226
|
+
#
|
227
|
+
# Example:
|
228
|
+
#
|
229
|
+
#authenticator:
|
230
|
+
# class: FooModule::MyCustomAuthenticator
|
231
|
+
# source: /path/to/source.rb
|
232
|
+
# option_a: foo
|
233
|
+
# another_option: yeeha
|
234
|
+
#
|
235
|
+
# === Multiple Authenticators ==================================================
|
236
|
+
#
|
237
|
+
# If you need to have more than one source for authentication, such as an LDAP
|
238
|
+
# directory and a database, you can use multiple authenticators by making
|
239
|
+
# :authenticator an array of authenticators.
|
240
|
+
#
|
241
|
+
#authenticator:
|
242
|
+
# -
|
243
|
+
# class: CASServer::Authenticators::ActiveDirectoryLDAP
|
244
|
+
# ldap:
|
245
|
+
# server: ad.example.net
|
246
|
+
# port: 389
|
247
|
+
# base: dc=example,dc=net
|
248
|
+
# filter: (objectClass=person)
|
249
|
+
# -
|
250
|
+
# class: CASServer::Authenticators::SQL
|
251
|
+
# database:
|
252
|
+
# adapter: mysql
|
253
|
+
# database: some_database_with_users_table
|
254
|
+
# user: root
|
255
|
+
# password:
|
256
|
+
# server: localhost
|
257
|
+
# user_table: user
|
258
|
+
# username_column: username
|
259
|
+
# password_column: password
|
260
|
+
#
|
261
|
+
# During authentication, the user credentials will be checked against the first
|
262
|
+
# authenticator and on failure fall through to the second authenticator.
|
263
|
+
#
|
264
|
+
|
265
|
+
|
266
|
+
##### LOOK & FEEL ##############################################################
|
267
|
+
|
268
|
+
# Set the path to the theme directory that determines how your CAS pages look.
|
269
|
+
#
|
270
|
+
# Custom themes are not well supported yet, but will be in the near future. In
|
271
|
+
# the meantime, if you want to create a custom theme, you can create a
|
272
|
+
# subdirectory under the CASServer's themes dir (for example,
|
273
|
+
# '/usr/lib/ruby/1.8/gems/casserver-xxx/lib/themes', if you installed CASServer
|
274
|
+
# on Linux as a gem). A theme is basically just a theme.css file that overrides
|
275
|
+
# the themes/cas.css styles along with a collection of image files
|
276
|
+
# like logo.png and bg.png.
|
277
|
+
#
|
278
|
+
# By default, we use the 'simple' theme which you can find in themes/simple.
|
279
|
+
theme: simple
|
280
|
+
|
281
|
+
# The name of your company/organization. This will show up on the login page.
|
282
|
+
organization: CAS
|
283
|
+
|
284
|
+
# A short bit of text that shows up on the login page. You can make this blank
|
285
|
+
# if you prefer to have no extra text shown at the bottom of the login box.
|
286
|
+
infoline: Powered by <a href="http://code.google.com/p/rubycas-server/">RubyCAS-Server</a>
|
287
|
+
|
288
|
+
# Custom views file. Overrides methodes in lib/casserver/views.rb
|
289
|
+
#custom_views_file: /path/to/custom/views.rb
|
290
|
+
|
291
|
+
|
292
|
+
##### LOGGING ##################################################################
|
293
|
+
|
294
|
+
# Configure general logging. This log is where you'll want to look in case of
|
295
|
+
# problems.
|
296
|
+
#
|
297
|
+
# You may want to change the file to something like /var/log/casserver.log
|
298
|
+
# Set the level to DEBUG if you want more detailed logging.
|
299
|
+
|
300
|
+
log:
|
301
|
+
file: /var/log/casserver.log
|
302
|
+
level: INFO
|
303
|
+
|
304
|
+
|
305
|
+
# If you want full database logging, uncomment this next section.
|
306
|
+
# Every SQL query will be logged here. This is useful for debugging database
|
307
|
+
# problems.
|
308
|
+
#
|
309
|
+
#db_log:
|
310
|
+
# file: /var/log/casserver_db.log
|
311
|
+
|
312
|
+
|
313
|
+
##### SINGLE SIGN-OUT ##########################################################
|
314
|
+
|
315
|
+
# When a user logs in to a CAS-enabled client application, that application
|
316
|
+
# generally opens its own local user session. When the user then logs out
|
317
|
+
# through the CAS server, each of the CAS-enabled client applications need
|
318
|
+
# to be notified so that they can close their own local sessions for that user.
|
319
|
+
#
|
320
|
+
# Up until recently this was not possible within CAS. However, a method for
|
321
|
+
# performing this notification was recently added to the protocol (in CAS 3.1).
|
322
|
+
# This works exactly as described above -- when the user logs out, the CAS
|
323
|
+
# server individually contacts each client service and notifies it of the
|
324
|
+
# logout. Currently not all client applications support this, so this
|
325
|
+
# behaviour is disabled by default. To enable it, uncomment the following
|
326
|
+
# configuration line. Note that currently it is not possible to enable
|
327
|
+
# or disable single-sign-out on a per-service basis, but this functionality
|
328
|
+
# is planned for a future release.
|
329
|
+
|
330
|
+
#enable_single_sign_out: true
|
331
|
+
|
332
|
+
|
333
|
+
##### OTHER ####################################################################
|
334
|
+
|
335
|
+
# You can set various ticket expiry times (specify the value in seconds).
|
336
|
+
|
337
|
+
# Expired login and service tickets are no longer usable this many seconds after
|
338
|
+
# they are created. (Defaults to 5 minutes)
|
339
|
+
|
340
|
+
#login_ticket_expiry: 300
|
341
|
+
#service_ticket_expiry: 300
|
342
|
+
|
343
|
+
# Proxy- and ticket-granting tickets do not expire -- normally they are made
|
344
|
+
# invalid only when the user logs out. But the server must periodically delete
|
345
|
+
# them to prevent buildup of stale data. PGTs and TGTs will be deleted during
|
346
|
+
# server startup if they are this many seconds old. (Defaults to 48 hours)
|
347
|
+
|
348
|
+
#proxy_granting_ticket_expiry: 172800
|
349
|
+
#ticket_granting_ticket_expiry: 172800
|
350
|
+
|
351
|
+
# If you would prefer that ticket-granting ticket expiry be enforced (in effect
|
352
|
+
# limiting the maximum length of a session), you can set expire_sessions to true.
|
353
|
+
|
354
|
+
#expire_sessions: false
|
355
|
+
|
356
|
+
|
357
|
+
# If you want the usernames entered on the login page to be automatically
|
358
|
+
# downcased (converted to lowercase), enable the following option. When this
|
359
|
+
# option is set to true, if the user enters "JSmith" as their username, the
|
360
|
+
# system will automatically
|
361
|
+
# convert this to "jsmith".
|
362
|
+
|
363
|
+
#downcase_username: true
|