rubycas-server 0.6.0 → 0.7.0
Sign up to get free protection for your applications and to get access to all the features.
- data/CHANGELOG.txt +1 -186
- data/History.txt +247 -0
- data/Manifest.txt +27 -2
- data/PostInstall.txt +3 -0
- data/Rakefile +4 -60
- data/bin/rubycas-server +2 -2
- data/bin/rubycas-server-ctl +0 -0
- data/casserver.db +0 -0
- data/casserver.log +792 -0
- data/casserver_db.log +88 -0
- data/config/hoe.rb +76 -0
- data/config/requirements.rb +15 -0
- data/config.example.yml +130 -6
- data/lib/casserver/authenticators/base.rb +20 -0
- data/lib/casserver/authenticators/client_certificate.rb +46 -0
- data/lib/casserver/authenticators/google.rb +54 -0
- data/lib/casserver/authenticators/ldap.rb +70 -40
- data/lib/casserver/authenticators/ntlm.rb +88 -0
- data/lib/casserver/authenticators/open_id.rb +22 -0
- data/lib/casserver/authenticators/sql.rb +66 -1
- data/lib/casserver/authenticators/sql_md5.rb +19 -0
- data/lib/casserver/authenticators/test.rb +5 -1
- data/lib/casserver/cas.rb +97 -22
- data/lib/casserver/controllers.rb +95 -34
- data/lib/casserver/environment.rb +16 -9
- data/lib/casserver/models.rb +38 -10
- data/lib/casserver/version.rb +1 -1
- data/lib/casserver/views.rb +38 -22
- data/lib/casserver.rb +13 -9
- data/lib/rubycas-server/version.rb +1 -0
- data/lib/rubycas-server.rb +1 -1
- data/lib/themes/notice.png +0 -0
- data/lib/themes/simple/logo.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/script/console +10 -0
- data/script/destroy +14 -0
- data/script/generate +14 -0
- data/script/txt2html +82 -0
- data/tasks/deployment.rake +34 -0
- data/tasks/environment.rake +7 -0
- data/tasks/website.rake +17 -0
- data/website/index.html +40 -0
- data/website/index.txt +3 -0
- data/website/javascripts/rounded_corners_lite.inc.js +285 -0
- data/website/stylesheets/screen.css +138 -0
- data/website/template.html.erb +40 -0
- metadata +45 -33
- data/test/test_cas.rb +0 -33
- data/test/test_casserver.rb +0 -125
data/casserver_db.log
ADDED
@@ -0,0 +1,88 @@
|
|
1
|
+
# Logfile created on Thu Mar 08 17:06:32 -0500 2007 by logger.rb/1.5.2.9
|
2
|
+
[4;36;1mSQL (0.000991)[0m [0;1mSELECT name FROM sqlite_master WHERE type = 'table'[0m
|
3
|
+
[4;35;1mSQL (0.102929)[0m [0mCREATE TABLE casserver_schema_infos ("id" INTEGER PRIMARY KEY NOT NULL, "version" float DEFAULT NULL) [0m
|
4
|
+
[4;36;1mCASServer::Models::SchemaInfo Load (0.000248)[0m [0;1mSELECT * FROM casserver_schema_infos LIMIT 1[0m
|
5
|
+
[4;35;1mSQL (0.000000)[0m [0mSQLite3::SQLException: no such table: casserver_login_tickets: DROP TABLE casserver_login_tickets[0m
|
6
|
+
[4;36;1mSQL (0.088360)[0m [0;1mCREATE TABLE casserver_login_tickets ("id" INTEGER PRIMARY KEY NOT NULL, "ticket" varchar(255) NOT NULL, "created_on" datetime NOT NULL, "consumed" datetime DEFAULT NULL, "client_hostname" varchar(255) NOT NULL) [0m
|
7
|
+
[4;35;1mSQL (0.000000)[0m [0mSQLite3::SQLException: no such table: casserver_service_tickets: DROP TABLE casserver_service_tickets[0m
|
8
|
+
[4;36;1mSQL (0.073950)[0m [0;1mCREATE TABLE casserver_service_tickets ("id" INTEGER PRIMARY KEY NOT NULL, "ticket" varchar(255) NOT NULL, "service" varchar(255) NOT NULL, "created_on" datetime NOT NULL, "consumed" datetime DEFAULT NULL, "client_hostname" varchar(255) NOT NULL, "username" varchar(255) NOT NULL, "type" varchar(255) NOT NULL, "proxy_granting_ticket_id" integer DEFAULT NULL) [0m
|
9
|
+
[4;35;1mSQL (0.000000)[0m [0mSQLite3::SQLException: no such table: casserver_ticket_granting_tickets: DROP TABLE casserver_ticket_granting_tickets[0m
|
10
|
+
[4;36;1mSQL (0.074600)[0m [0;1mCREATE TABLE casserver_ticket_granting_tickets ("id" INTEGER PRIMARY KEY NOT NULL, "ticket" varchar(255) NOT NULL, "created_on" datetime NOT NULL, "client_hostname" varchar(255) NOT NULL, "username" varchar(255) NOT NULL) [0m
|
11
|
+
[4;35;1mSQL (0.000000)[0m [0mSQLite3::SQLException: no such table: casserver_proxy_granting_tickets: DROP TABLE casserver_proxy_granting_tickets[0m
|
12
|
+
[4;36;1mSQL (0.090874)[0m [0;1mCREATE TABLE casserver_proxy_granting_tickets ("id" INTEGER PRIMARY KEY NOT NULL, "ticket" varchar(255) NOT NULL, "created_on" datetime NOT NULL, "client_hostname" varchar(255) NOT NULL, "iou" varchar(255) NOT NULL, "service_ticket_id" integer NOT NULL) [0m
|
13
|
+
[4;35;1mSQL (0.000414)[0m [0mINSERT INTO casserver_schema_infos ("version") VALUES(0.1)[0m
|
14
|
+
[4;36;1mCASServer::Models::ServiceTicket Load (0.000325)[0m [0;1mSELECT * FROM casserver_service_tickets WHERE (created_on < '2007-03-08 17:04:11') AND ( (casserver_service_tickets."type" = 'ServiceTicket' OR casserver_service_tickets."type" = 'ProxyTicket' ) ) [0m
|
15
|
+
[4;35;1mCASServer::Models::LoginTicket Load (0.000234)[0m [0mSELECT * FROM casserver_login_tickets WHERE (created_on < '2007-03-08 17:04:11') [0m
|
16
|
+
[4;36;1mCASServer::Models::ProxyGrantingTicket Load (0.000242)[0m [0;1mSELECT * FROM casserver_proxy_granting_tickets WHERE (created_on < '2007-03-06 17:09:11') [0m
|
17
|
+
[4;35;1mCASServer::Models::TicketGrantingTicket Load (0.000228)[0m [0mSELECT * FROM casserver_ticket_granting_tickets WHERE (created_on < '2007-03-06 17:09:11') [0m
|
18
|
+
[4;36;1mSQL (0.001784)[0m [0;1mSELECT name FROM sqlite_master WHERE type = 'table'[0m
|
19
|
+
[4;35;1mCASServer::Models::SchemaInfo Load (0.000302)[0m [0mSELECT * FROM casserver_schema_infos LIMIT 1[0m
|
20
|
+
[4;36;1mCASServer::Models::ServiceTicket Load (0.000226)[0m [0;1mSELECT * FROM casserver_service_tickets WHERE (created_on < '2007-03-08 17:06:34') AND ( (casserver_service_tickets."type" = 'ServiceTicket' OR casserver_service_tickets."type" = 'ProxyTicket' ) ) [0m
|
21
|
+
[4;35;1mCASServer::Models::LoginTicket Load (0.000158)[0m [0mSELECT * FROM casserver_login_tickets WHERE (created_on < '2007-03-08 17:06:34') [0m
|
22
|
+
[4;36;1mCASServer::Models::ProxyGrantingTicket Load (0.000164)[0m [0;1mSELECT * FROM casserver_proxy_granting_tickets WHERE (created_on < '2007-03-06 17:11:34') [0m
|
23
|
+
[4;35;1mCASServer::Models::TicketGrantingTicket Load (0.000240)[0m [0mSELECT * FROM casserver_ticket_granting_tickets WHERE (created_on < '2007-03-06 17:11:34') [0m
|
24
|
+
[4;36;1mSQL (0.001727)[0m [0;1mSELECT name FROM sqlite_master WHERE type = 'table'[0m
|
25
|
+
[4;35;1mCASServer::Models::SchemaInfo Load (0.000334)[0m [0mSELECT * FROM casserver_schema_infos LIMIT 1[0m
|
26
|
+
[4;36;1mCASServer::Models::ServiceTicket Load (0.000223)[0m [0;1mSELECT * FROM casserver_service_tickets WHERE (created_on < '2007-03-08 17:27:21') AND ( (casserver_service_tickets."type" = 'ServiceTicket' OR casserver_service_tickets."type" = 'ProxyTicket' ) ) [0m
|
27
|
+
[4;35;1mCASServer::Models::LoginTicket Load (0.000162)[0m [0mSELECT * FROM casserver_login_tickets WHERE (created_on < '2007-03-08 17:27:21') [0m
|
28
|
+
[4;36;1mCASServer::Models::ProxyGrantingTicket Load (0.000164)[0m [0;1mSELECT * FROM casserver_proxy_granting_tickets WHERE (created_on < '2007-03-06 17:32:21') [0m
|
29
|
+
[4;35;1mCASServer::Models::TicketGrantingTicket Load (0.000175)[0m [0mSELECT * FROM casserver_ticket_granting_tickets WHERE (created_on < '2007-03-06 17:32:21') [0m
|
30
|
+
[4;36;1mSQL (0.001986)[0m [0;1mSELECT name FROM sqlite_master WHERE type = 'table'[0m
|
31
|
+
[4;35;1mCASServer::Models::SchemaInfo Load (0.000366)[0m [0mSELECT * FROM casserver_schema_infos LIMIT 1[0m
|
32
|
+
[4;36;1mCASServer::Models::ServiceTicket Load (0.000251)[0m [0;1mSELECT * FROM casserver_service_tickets WHERE (created_on < '2007-03-08 17:28:07') AND ( (casserver_service_tickets."type" = 'ServiceTicket' OR casserver_service_tickets."type" = 'ProxyTicket' ) ) [0m
|
33
|
+
[4;35;1mCASServer::Models::LoginTicket Load (0.000185)[0m [0mSELECT * FROM casserver_login_tickets WHERE (created_on < '2007-03-08 17:28:07') [0m
|
34
|
+
[4;36;1mCASServer::Models::ProxyGrantingTicket Load (0.000210)[0m [0;1mSELECT * FROM casserver_proxy_granting_tickets WHERE (created_on < '2007-03-06 17:33:07') [0m
|
35
|
+
[4;35;1mCASServer::Models::TicketGrantingTicket Load (0.000170)[0m [0mSELECT * FROM casserver_ticket_granting_tickets WHERE (created_on < '2007-03-06 17:33:07') [0m
|
36
|
+
[4;36;1mSQL (0.001746)[0m [0;1mSELECT name FROM sqlite_master WHERE type = 'table'[0m
|
37
|
+
[4;35;1mCASServer::Models::SchemaInfo Load (0.000303)[0m [0mSELECT * FROM casserver_schema_infos LIMIT 1[0m
|
38
|
+
[4;36;1mCASServer::Models::ServiceTicket Load (0.000223)[0m [0;1mSELECT * FROM casserver_service_tickets WHERE (created_on < '2007-03-08 17:54:26') AND ( (casserver_service_tickets."type" = 'ServiceTicket' OR casserver_service_tickets."type" = 'ProxyTicket' ) ) [0m
|
39
|
+
[4;35;1mCASServer::Models::LoginTicket Load (0.000178)[0m [0mSELECT * FROM casserver_login_tickets WHERE (created_on < '2007-03-08 17:54:26') [0m
|
40
|
+
[4;36;1mCASServer::Models::ProxyGrantingTicket Load (0.000175)[0m [0;1mSELECT * FROM casserver_proxy_granting_tickets WHERE (created_on < '2007-03-06 17:59:26') [0m
|
41
|
+
[4;35;1mCASServer::Models::TicketGrantingTicket Load (0.000169)[0m [0mSELECT * FROM casserver_ticket_granting_tickets WHERE (created_on < '2007-03-06 17:59:26') [0m
|
42
|
+
[4;36;1mSQL (0.001771)[0m [0;1mSELECT name FROM sqlite_master WHERE type = 'table'[0m
|
43
|
+
[4;35;1mCASServer::Models::SchemaInfo Load (0.000445)[0m [0mSELECT * FROM casserver_schema_infos LIMIT 1[0m
|
44
|
+
[4;36;1mCASServer::Models::ServiceTicket Load (0.000221)[0m [0;1mSELECT * FROM casserver_service_tickets WHERE (created_on < '2007-03-08 17:54:32') AND ( (casserver_service_tickets."type" = 'ServiceTicket' OR casserver_service_tickets."type" = 'ProxyTicket' ) ) [0m
|
45
|
+
[4;35;1mCASServer::Models::LoginTicket Load (0.000171)[0m [0mSELECT * FROM casserver_login_tickets WHERE (created_on < '2007-03-08 17:54:32') [0m
|
46
|
+
[4;36;1mCASServer::Models::ProxyGrantingTicket Load (0.000163)[0m [0;1mSELECT * FROM casserver_proxy_granting_tickets WHERE (created_on < '2007-03-06 17:59:32') [0m
|
47
|
+
[4;35;1mCASServer::Models::TicketGrantingTicket Load (0.000161)[0m [0mSELECT * FROM casserver_ticket_granting_tickets WHERE (created_on < '2007-03-06 17:59:32') [0m
|
48
|
+
[4;36;1mSQL (0.002972)[0m [0;1mSELECT name FROM sqlite_master WHERE type = 'table'[0m
|
49
|
+
[4;35;1mCASServer::Models::SchemaInfo Load (0.000419)[0m [0mSELECT * FROM casserver_schema_infos LIMIT 1[0m
|
50
|
+
[4;36;1mCASServer::Models::ServiceTicket Load (0.000233)[0m [0;1mSELECT * FROM casserver_service_tickets WHERE (created_on < '2007-03-08 17:55:13') AND ( (casserver_service_tickets."type" = 'ServiceTicket' OR casserver_service_tickets."type" = 'ProxyTicket' ) ) [0m
|
51
|
+
[4;35;1mCASServer::Models::LoginTicket Load (0.000185)[0m [0mSELECT * FROM casserver_login_tickets WHERE (created_on < '2007-03-08 17:55:13') [0m
|
52
|
+
[4;36;1mCASServer::Models::ProxyGrantingTicket Load (0.000166)[0m [0;1mSELECT * FROM casserver_proxy_granting_tickets WHERE (created_on < '2007-03-06 18:00:13') [0m
|
53
|
+
[4;35;1mCASServer::Models::TicketGrantingTicket Load (0.000161)[0m [0mSELECT * FROM casserver_ticket_granting_tickets WHERE (created_on < '2007-03-06 18:00:13') [0m
|
54
|
+
[4;36;1mSQL (0.000631)[0m [0;1mINSERT INTO casserver_login_tickets ("created_on", "ticket", "client_hostname", "consumed") VALUES('2007-03-08 18:00:45', 'LT-1173394845r40D9611E5DEBE39C26FAFD7E295', 'mzukowski.urbacon.net', NULL)[0m
|
55
|
+
[4;35;1mCASServer::Models::LoginTicket Load (0.000656)[0m [0mSELECT * FROM casserver_login_tickets WHERE (casserver_login_tickets."ticket" = 'LT-1173394845r40D9611E5DEBE39C26FAFD7E295') LIMIT 1[0m
|
56
|
+
[4;36;1mCASServer::Models::LoginTicket Update (0.000583)[0m [0;1mUPDATE casserver_login_tickets SET "client_hostname" = 'mzukowski.urbacon.net', "ticket" = 'LT-1173394845r40D9611E5DEBE39C26FAFD7E295', "consumed" = '2007-03-08 18:00:52', "created_on" = '2007-03-08 18:00:45' WHERE id = 1[0m
|
57
|
+
[4;35;1mSQL (0.000385)[0m [0mINSERT INTO casserver_login_tickets ("created_on", "ticket", "client_hostname", "consumed") VALUES('2007-03-08 18:00:52', 'LT-1173394852r4A6A482E92868C23EAD492788D', 'mzukowski.urbacon.net', NULL)[0m
|
58
|
+
[4;36;1mSQL (0.000323)[0m [0;1mINSERT INTO casserver_ticket_granting_tickets ("created_on", "ticket", "username", "client_hostname") VALUES('2007-03-08 18:00:52', 'TGC-1173394852r1E2C91CD940D7A6E3129DE72680', 'mzukowski', 'mzukowski.urbacon.net')[0m
|
59
|
+
[4;36;1mSQL (0.003985)[0m [0;1mSELECT name FROM sqlite_master WHERE type = 'table'[0m
|
60
|
+
[4;35;1mCASServer::Models::SchemaInfo Load (0.000317)[0m [0mSELECT * FROM casserver_schema_infos LIMIT 1[0m
|
61
|
+
[4;36;1mCASServer::Models::ServiceTicket Load (0.000235)[0m [0;1mSELECT * FROM casserver_service_tickets WHERE (created_on < '2007-03-08 18:04:03') AND ( (casserver_service_tickets."type" = 'ServiceTicket' OR casserver_service_tickets."type" = 'ProxyTicket' ) ) [0m
|
62
|
+
[4;35;1mCASServer::Models::LoginTicket Load (0.000520)[0m [0mSELECT * FROM casserver_login_tickets WHERE (created_on < '2007-03-08 18:04:03') [0m
|
63
|
+
[4;36;1mCASServer::Models::LoginTicket Destroy (0.000475)[0m [0;1m DELETE FROM casserver_login_tickets
|
64
|
+
WHERE id = 1
|
65
|
+
[0m
|
66
|
+
[4;35;1mCASServer::Models::LoginTicket Destroy (0.000108)[0m [0m DELETE FROM casserver_login_tickets
|
67
|
+
WHERE id = 2
|
68
|
+
[0m
|
69
|
+
[4;36;1mCASServer::Models::ProxyGrantingTicket Load (0.000182)[0m [0;1mSELECT * FROM casserver_proxy_granting_tickets WHERE (created_on < '2007-03-06 18:09:03') [0m
|
70
|
+
[4;35;1mCASServer::Models::TicketGrantingTicket Load (0.000173)[0m [0mSELECT * FROM casserver_ticket_granting_tickets WHERE (created_on < '2007-03-06 18:09:03') [0m
|
71
|
+
[4;36;1mSQL (0.000521)[0m [0;1mINSERT INTO casserver_login_tickets ("created_on", "ticket", "client_hostname", "consumed") VALUES('2007-03-08 18:09:09', 'LT-1173395349r21CE5E4AE47C71F250F632563D8', 'mzukowski.urbacon.net', NULL)[0m
|
72
|
+
[4;35;1mCASServer::Models::LoginTicket Load (0.000479)[0m [0mSELECT * FROM casserver_login_tickets WHERE (casserver_login_tickets."ticket" = 'LT-1173395349r21CE5E4AE47C71F250F632563D8') LIMIT 1[0m
|
73
|
+
[4;36;1mCASServer::Models::LoginTicket Update (0.000399)[0m [0;1mUPDATE casserver_login_tickets SET "client_hostname" = 'mzukowski.urbacon.net', "ticket" = 'LT-1173395349r21CE5E4AE47C71F250F632563D8', "consumed" = '2007-03-08 18:09:16', "created_on" = '2007-03-08 18:09:09' WHERE id = 1[0m
|
74
|
+
[4;35;1mSQL (0.000385)[0m [0mINSERT INTO casserver_login_tickets ("created_on", "ticket", "client_hostname", "consumed") VALUES('2007-03-08 18:09:16', 'LT-1173395356r4E1EB273E2EBF9E418F47C9B3E2', 'mzukowski.urbacon.net', NULL)[0m
|
75
|
+
[4;36;1mSQL (0.000330)[0m [0;1mINSERT INTO casserver_ticket_granting_tickets ("created_on", "ticket", "username", "client_hostname") VALUES('2007-03-08 18:09:16', 'TGC-1173395356r53A8C4AD580D74F60C8A10CEFB', 'mzukowski', 'mzukowski.urbacon.net')[0m
|
76
|
+
[4;36;1mSQL (0.003537)[0m [0;1mSELECT name FROM sqlite_master WHERE type = 'table'[0m
|
77
|
+
[4;35;1mCASServer::Models::SchemaInfo Load (0.000343)[0m [0mSELECT * FROM casserver_schema_infos LIMIT 1[0m
|
78
|
+
[4;36;1mCASServer::Models::ServiceTicket Load (0.000233)[0m [0;1mSELECT * FROM casserver_service_tickets WHERE (created_on < '2007-03-08 18:04:49') AND ( (casserver_service_tickets."type" = 'ServiceTicket' OR casserver_service_tickets."type" = 'ProxyTicket' ) ) [0m
|
79
|
+
[4;35;1mCASServer::Models::LoginTicket Load (0.000187)[0m [0mSELECT * FROM casserver_login_tickets WHERE (created_on < '2007-03-08 18:04:49') [0m
|
80
|
+
[4;36;1mCASServer::Models::ProxyGrantingTicket Load (0.000164)[0m [0;1mSELECT * FROM casserver_proxy_granting_tickets WHERE (created_on < '2007-03-06 18:09:49') [0m
|
81
|
+
[4;35;1mCASServer::Models::TicketGrantingTicket Load (0.000229)[0m [0mSELECT * FROM casserver_ticket_granting_tickets WHERE (created_on < '2007-03-06 18:09:49') [0m
|
82
|
+
[4;36;1mCASServer::Models::LoginTicket Load (0.000505)[0m [0;1mSELECT * FROM casserver_login_tickets WHERE (casserver_login_tickets."ticket" = 'LT-1173395349r21CE5E4AE47C71F250F632563D8') LIMIT 1[0m
|
83
|
+
[4;35;1mCASServer::Models::LoginTicket Update (0.000681)[0m [0mUPDATE casserver_login_tickets SET "client_hostname" = 'mzukowski.urbacon.net', "ticket" = 'LT-1173395349r21CE5E4AE47C71F250F632563D8', "consumed" = '2007-03-08 18:09:55', "created_on" = '2007-03-08 18:09:09' WHERE id = 1[0m
|
84
|
+
[4;36;1mSQL (0.000567)[0m [0;1mINSERT INTO casserver_login_tickets ("created_on", "ticket", "client_hostname", "consumed") VALUES('2007-03-08 18:10:02', 'LT-1173395402r347DF2CB4392E0DC7511B4B0A6B', 'mzukowski.urbacon.net', NULL)[0m
|
85
|
+
[4;35;1mCASServer::Models::LoginTicket Load (0.000516)[0m [0mSELECT * FROM casserver_login_tickets WHERE (casserver_login_tickets."ticket" = 'LT-1173395402r347DF2CB4392E0DC7511B4B0A6B') LIMIT 1[0m
|
86
|
+
[4;36;1mCASServer::Models::LoginTicket Update (0.000494)[0m [0;1mUPDATE casserver_login_tickets SET "client_hostname" = 'mzukowski.urbacon.net', "ticket" = 'LT-1173395402r347DF2CB4392E0DC7511B4B0A6B', "consumed" = '2007-03-08 18:10:04', "created_on" = '2007-03-08 18:10:02' WHERE id = 3[0m
|
87
|
+
[4;35;1mSQL (0.000247)[0m [0mINSERT INTO casserver_login_tickets ("created_on", "ticket", "client_hostname", "consumed") VALUES('2007-03-08 18:10:04', 'LT-1173395404r19BD3B2C6C6B95CD4F16E04CB1B', 'mzukowski.urbacon.net', NULL)[0m
|
88
|
+
[4;36;1mSQL (0.000340)[0m [0;1mINSERT INTO casserver_ticket_granting_tickets ("created_on", "ticket", "username", "client_hostname") VALUES('2007-03-08 18:10:04', 'TGC-1173395404r20594EBFDC11A5D7E1437046197', 'mzukowski', 'mzukowski.urbacon.net')[0m
|
data/config/hoe.rb
ADDED
@@ -0,0 +1,76 @@
|
|
1
|
+
require 'rubycas-server/version'
|
2
|
+
|
3
|
+
AUTHOR = 'Matt Zukowski' # can also be an array of Authors
|
4
|
+
EMAIL = "matt@zukowski.ca"
|
5
|
+
DESCRIPTION = "Provides single sign-on authentication for web applications using the CAS protocol."
|
6
|
+
GEM_NAME = 'rubycas-server' # what ppl will type to install your gem
|
7
|
+
RUBYFORGE_PROJECT = 'rubycas-server' # The unix name for your project
|
8
|
+
HOMEPATH = "http://#{RUBYFORGE_PROJECT}.rubyforge.org"
|
9
|
+
DOWNLOAD_PATH = "http://rubyforge.org/projects/#{RUBYFORGE_PROJECT}"
|
10
|
+
EXTRA_DEPENDENCIES = [
|
11
|
+
'activesupport',
|
12
|
+
'activerecord',
|
13
|
+
['picnic', '>= 0.7.0']
|
14
|
+
] # An array of rubygem dependencies [name, version]
|
15
|
+
|
16
|
+
@config_file = "~/.rubyforge/user-config.yml"
|
17
|
+
@config = nil
|
18
|
+
RUBYFORGE_USERNAME = "unknown"
|
19
|
+
def rubyforge_username
|
20
|
+
unless @config
|
21
|
+
begin
|
22
|
+
@config = YAML.load(File.read(File.expand_path(@config_file)))
|
23
|
+
rescue
|
24
|
+
puts <<-EOS
|
25
|
+
ERROR: No rubyforge config file found: #{@config_file}
|
26
|
+
Run 'rubyforge setup' to prepare your env for access to Rubyforge
|
27
|
+
- See http://newgem.rubyforge.org/rubyforge.html for more details
|
28
|
+
EOS
|
29
|
+
exit
|
30
|
+
end
|
31
|
+
end
|
32
|
+
RUBYFORGE_USERNAME.replace @config["username"]
|
33
|
+
end
|
34
|
+
|
35
|
+
ENV['NODOT'] = '1'
|
36
|
+
|
37
|
+
REV = nil
|
38
|
+
# UNCOMMENT IF REQUIRED:
|
39
|
+
#REV = YAML.load(`svn info`)['Revision']
|
40
|
+
VERS = CASServer::VERSION::STRING + (REV ? ".#{REV}" : "")
|
41
|
+
RDOC_OPTS = ['--quiet', '--title', 'rubycas-server documentation',
|
42
|
+
"--opname", "index.html",
|
43
|
+
"--line-numbers",
|
44
|
+
"--main", "README",
|
45
|
+
"--inline-source"]
|
46
|
+
|
47
|
+
class Hoe
|
48
|
+
def extra_deps
|
49
|
+
@extra_deps.reject! { |x| Array(x).first == 'hoe' }
|
50
|
+
@extra_deps
|
51
|
+
end
|
52
|
+
end
|
53
|
+
|
54
|
+
# Generate all the Rake tasks
|
55
|
+
# Run 'rake -T' to see list of generated tasks (from gem root directory)
|
56
|
+
$hoe = Hoe.new(GEM_NAME, VERS) do |p|
|
57
|
+
p.developer(AUTHOR, EMAIL)
|
58
|
+
p.description = DESCRIPTION
|
59
|
+
p.summary = DESCRIPTION
|
60
|
+
p.url = HOMEPATH
|
61
|
+
p.rubyforge_name = RUBYFORGE_PROJECT if RUBYFORGE_PROJECT
|
62
|
+
p.test_globs = ["test/**/test_*.rb"]
|
63
|
+
p.clean_globs |= ['**/.*.sw?', '*.gem', '.config', '**/.DS_Store'] #An array of file patterns to delete on clean.
|
64
|
+
|
65
|
+
# == Optional
|
66
|
+
p.changes = p.paragraphs_of("History.txt", 0..1).join("\n\n")
|
67
|
+
#p.extra_deps = EXTRA_DEPENDENCIES
|
68
|
+
|
69
|
+
p.spec_extras = {:executables => ['rubycas-server', 'rubycas-server-ctl']} # A hash of extra values to set in the gemspec.
|
70
|
+
end
|
71
|
+
|
72
|
+
CHANGES = $hoe.paragraphs_of('History.txt', 0..1).join("\\n\\n")
|
73
|
+
PATH = (RUBYFORGE_PROJECT == GEM_NAME) ? RUBYFORGE_PROJECT : "#{RUBYFORGE_PROJECT}"
|
74
|
+
$hoe.remote_rdoc_dir = File.join(PATH.gsub(/^#{RUBYFORGE_PROJECT}\/?/,''), 'rdoc')
|
75
|
+
$hoe.rsync_args = '-av --delete --ignore-errors'
|
76
|
+
$hoe.spec.post_install_message = File.open(File.dirname(__FILE__) + "/../PostInstall.txt").read rescue ""
|
@@ -0,0 +1,15 @@
|
|
1
|
+
require 'fileutils'
|
2
|
+
include FileUtils
|
3
|
+
|
4
|
+
require 'rubygems'
|
5
|
+
%w[rake hoe newgem rubigen].each do |req_gem|
|
6
|
+
begin
|
7
|
+
require req_gem
|
8
|
+
rescue LoadError
|
9
|
+
puts "This Rakefile requires the '#{req_gem}' RubyGem."
|
10
|
+
puts "Installation: gem install #{req_gem} -y"
|
11
|
+
exit
|
12
|
+
end
|
13
|
+
end
|
14
|
+
|
15
|
+
$:.unshift(File.join(File.dirname(__FILE__), %w[.. lib]))
|
data/config.example.yml
CHANGED
@@ -119,6 +119,9 @@ database:
|
|
119
119
|
# If you prefer to have your passwords stored in an encrypted form, have a
|
120
120
|
# look at the SQLEncrypted authenticator:
|
121
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.
|
122
125
|
#
|
123
126
|
# Example:
|
124
127
|
#
|
@@ -134,6 +137,61 @@ database:
|
|
134
137
|
# username_column: username
|
135
138
|
# password_column: password
|
136
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
|
+
# === Google Authentication ====================================================
|
164
|
+
#
|
165
|
+
# The Google authenticator allows users to log in to your CAS server using
|
166
|
+
# their Google account credentials (i.e. the same email and password they
|
167
|
+
# would use to log in to Google services like Gmail). This authenticator
|
168
|
+
# requires no special configuration -- just specify its class name:
|
169
|
+
#
|
170
|
+
#authenticator:
|
171
|
+
# class: CASServer::Authenticators::Google
|
172
|
+
#
|
173
|
+
# Note that as with all authenticators, it is possible to use the Google
|
174
|
+
# authenticator alongside other authenticators. For example, CAS can first
|
175
|
+
# attempt to validate the account with Google, and if that fails, fall back
|
176
|
+
# to some other local authentication mechanism.
|
177
|
+
#
|
178
|
+
# For example:
|
179
|
+
#
|
180
|
+
#authenticator:
|
181
|
+
# -
|
182
|
+
# class: CASServer::Authenticators::Google
|
183
|
+
# -
|
184
|
+
# class: CASServer::Authenticators::SQL
|
185
|
+
# database:
|
186
|
+
# adapter: mysql
|
187
|
+
# database: some_database_with_users_table
|
188
|
+
# user: root
|
189
|
+
# password:
|
190
|
+
# server: localhost
|
191
|
+
# user_table: user
|
192
|
+
# username_column: username
|
193
|
+
# password_column: password
|
194
|
+
#
|
137
195
|
#
|
138
196
|
# === ActiveDirectory Authentication ===========================================
|
139
197
|
#
|
@@ -145,9 +203,11 @@ database:
|
|
145
203
|
# to be an administrative account -- it only has to be able to search for other
|
146
204
|
# users.
|
147
205
|
#
|
148
|
-
# Note that the auth_user parameter must be the user's CN (Common Name)
|
149
|
-
# In Active Directory, the CN is genarally the user's full name, which is
|
150
|
-
# the same as their username (sAMAccountName).
|
206
|
+
# Note that the auth_user parameter must be the user's CN (Common Name).
|
207
|
+
# In Active Directory, the CN is genarally the user's full name, which is NOT
|
208
|
+
# generally the same as their username (sAMAccountName).
|
209
|
+
#
|
210
|
+
# For example:
|
151
211
|
#
|
152
212
|
#authenticator:
|
153
213
|
# class: CASServer::Authenticators::ActiveDirectoryLDAP
|
@@ -159,6 +219,22 @@ database:
|
|
159
219
|
# auth_user: authenticator
|
160
220
|
# auth_password: itsasecret
|
161
221
|
#
|
222
|
+
# A more complicated example, where the authenticator will use TLS encryption,
|
223
|
+
# will ignore users with disabled accounts, and will pass on the 'cn' and 'mail'
|
224
|
+
# attributes to CAS clients:
|
225
|
+
#
|
226
|
+
#authenticator:
|
227
|
+
# class: CASServer::Authenticators::ActiveDirectoryLDAP
|
228
|
+
# ldap:
|
229
|
+
# server: ad.example.net
|
230
|
+
# port: 636
|
231
|
+
# base: dc=example,dc=net
|
232
|
+
# filter: (objectClass=person) & !(msExchHideFromAddressLists=TRUE)
|
233
|
+
# auth_user: authenticator
|
234
|
+
# auth_password: itsasecret
|
235
|
+
# encryption: simple_tls
|
236
|
+
# extra_attributes: cn, mail
|
237
|
+
#
|
162
238
|
# It is possible to authenticate against Active Directory without the
|
163
239
|
# authenticator user, but this requires that users type in their CN as
|
164
240
|
# the username rather than typing in their sAMAccountName. In other words
|
@@ -173,14 +249,42 @@ database:
|
|
173
249
|
# The configuration is similar, except you don't need an authenticator
|
174
250
|
# username or password. Note that this authenticator hasn't been widely
|
175
251
|
# tested, so it is not guaranteed to work.
|
176
|
-
|
252
|
+
#
|
177
253
|
#authenticator:
|
178
|
-
# class: CASServer::Authenticators::
|
254
|
+
# class: CASServer::Authenticators::LDAP
|
179
255
|
# ldap:
|
180
|
-
# server:
|
256
|
+
# server: ldap.example.net
|
257
|
+
# port: 389
|
258
|
+
# base: dc=example,dc=net
|
259
|
+
# filter: (objectClass=person)
|
260
|
+
#
|
261
|
+
# If you need more secure connections via TSL, specify the 'encryption'
|
262
|
+
# option and change the port:
|
263
|
+
#
|
264
|
+
#authenticator:
|
265
|
+
# class: CASServer::Authenticators::LDAP
|
266
|
+
# ldap:
|
267
|
+
# server: ldap.example.net
|
268
|
+
# port: 636
|
269
|
+
# base: dc=example,dc=net
|
270
|
+
# filter: (objectClass=person)
|
271
|
+
# encryption: simple_tls
|
272
|
+
#
|
273
|
+
# If you need additional data about the user passed to the client (for example,
|
274
|
+
# their 'cn' and 'mail' attributes, you can specify the list of attributes
|
275
|
+
# under the extra_attributes config option:
|
276
|
+
#
|
277
|
+
#authenticator:
|
278
|
+
# class: CASServer::Authenticators::LDAP
|
279
|
+
# ldap:
|
280
|
+
# server: ldap.example.net
|
181
281
|
# port: 389
|
182
282
|
# base: dc=example,dc=net
|
183
283
|
# filter: (objectClass=person)
|
284
|
+
# extra_attributes: cn, mail
|
285
|
+
#
|
286
|
+
# Note that the above functionality is somewhat limited by client compatibility.
|
287
|
+
# See the SQL authenticator notes above for more info.
|
184
288
|
#
|
185
289
|
#
|
186
290
|
# === Custom Authentication ====================================================
|
@@ -285,6 +389,26 @@ log:
|
|
285
389
|
# file: /var/log/casserver_db.log
|
286
390
|
|
287
391
|
|
392
|
+
##### SINGLE SIGN-OUT ##########################################################
|
393
|
+
|
394
|
+
# When a user logs in to a CAS-enabled client application, that application
|
395
|
+
# generally opens its own local user session. When the user then logs out
|
396
|
+
# through the CAS server, each of the CAS-enabled client applications need
|
397
|
+
# to be notified so that they can close their own local sessions for that user.
|
398
|
+
#
|
399
|
+
# Up until recently this was not possible within CAS. However, a method for
|
400
|
+
# performing this notification was recently added to the protocol (in CAS 3.1).
|
401
|
+
# This works exactly as described above -- when the user logs out, the CAS
|
402
|
+
# server individually contacts each client service and notifies it of the
|
403
|
+
# logout. Currently not all client applications support this, so this
|
404
|
+
# behaviour is disabled by default. To enable it, uncomment the following
|
405
|
+
# configuration line. Note that currently it is not possible to enable
|
406
|
+
# or disable single-sign-out on a per-service basis, but this functionality
|
407
|
+
# is planned for a future release.
|
408
|
+
|
409
|
+
#enable_single_sign_out: true
|
410
|
+
|
411
|
+
|
288
412
|
##### OTHER ####################################################################
|
289
413
|
|
290
414
|
# You can set various ticket expiry times (specify the value in seconds).
|
@@ -12,6 +12,11 @@ module CASServer
|
|
12
12
|
def configure(options)
|
13
13
|
raise ArgumentError, "options must be a HashWithIndifferentAccess" unless options.kind_of? HashWithIndifferentAccess
|
14
14
|
@options = options.dup
|
15
|
+
@extra_attributes = {}
|
16
|
+
end
|
17
|
+
|
18
|
+
def extra_attributes
|
19
|
+
@extra_attributes
|
15
20
|
end
|
16
21
|
|
17
22
|
protected
|
@@ -19,6 +24,21 @@ module CASServer
|
|
19
24
|
@username = credentials[:username]
|
20
25
|
@password = credentials[:password]
|
21
26
|
@service = credentials[:service]
|
27
|
+
@request = credentials[:request]
|
28
|
+
end
|
29
|
+
|
30
|
+
def extra_attributes_to_extract
|
31
|
+
if @options[:extra_attributes].kind_of? Array
|
32
|
+
attrs = @options[:extra_attributes]
|
33
|
+
elsif @options[:extra_attributes].kind_of? String
|
34
|
+
attrs = @options[:extra_attributes].split(',').collect{|col| col.strip}
|
35
|
+
else
|
36
|
+
$LOG.error("Can't figure out attribute list from #{@options[:extra_attributes].inspect}. This must be an Aarray of column names or a comma-separated list.")
|
37
|
+
attrs = []
|
38
|
+
end
|
39
|
+
|
40
|
+
$LOG.debug("#{self.class.name} will try to extract the following extra_attributes: #{attrs.inspect}")
|
41
|
+
return attrs
|
22
42
|
end
|
23
43
|
end
|
24
44
|
end
|
@@ -0,0 +1,46 @@
|
|
1
|
+
require 'casserver/authenticators/base'
|
2
|
+
|
3
|
+
# NOT YET IMPLEMENTED
|
4
|
+
#
|
5
|
+
# This authenticator will authenticate the user based on a client SSL certificate.
|
6
|
+
#
|
7
|
+
# You will probably want to use this along with another authenticator, chaining
|
8
|
+
# it so that if the client does not provide a certificate, the server can
|
9
|
+
# fall back to some other authentication mechanism.
|
10
|
+
#
|
11
|
+
# Here's an example of how to use two chained authenticators in the config.yml
|
12
|
+
# file. The server will first use the ClientCertificate authenticator, and
|
13
|
+
# only fall back to the SQL authenticator of the first one fails:
|
14
|
+
#
|
15
|
+
# authenticator:
|
16
|
+
# -
|
17
|
+
# class: CASServer::Authenticators::ClientCertificate
|
18
|
+
# -
|
19
|
+
# class: CASServer::Authenticators::SQL
|
20
|
+
# database:
|
21
|
+
# adapter: mysql
|
22
|
+
# database: some_database_with_users_table
|
23
|
+
# user: root
|
24
|
+
# password:
|
25
|
+
# server: localhost
|
26
|
+
# user_table: user
|
27
|
+
# username_column: username
|
28
|
+
# password_column: password
|
29
|
+
#
|
30
|
+
class CASServer::Authenticators::ClientCertificate < CASServer::Authenticators::Base
|
31
|
+
def validate(credentials)
|
32
|
+
read_standard_credentials(credentials)
|
33
|
+
|
34
|
+
@client_cert = credentials[:request]['SSL_CLIENT_CERT']
|
35
|
+
|
36
|
+
# note that I haven't actually tested to see if SSL_CLIENT_CERT gets
|
37
|
+
# filled with data when a client cert is provided, but this should be
|
38
|
+
# the case at least in theory :)
|
39
|
+
|
40
|
+
return false if @client_cert.blank?
|
41
|
+
|
42
|
+
# IMPLEMENT SSL CERTIFICATE VALIDATION CODE HERE
|
43
|
+
|
44
|
+
return true # if SSL certificate is valid, false otherwise
|
45
|
+
end
|
46
|
+
end
|
@@ -0,0 +1,54 @@
|
|
1
|
+
require 'casserver/authenticators/base'
|
2
|
+
require 'uri'
|
3
|
+
require 'net/http'
|
4
|
+
require 'net/https'
|
5
|
+
require 'timeout'
|
6
|
+
|
7
|
+
# Validates Google accounts against Google's authentication service -- in other
|
8
|
+
# words, this authenticator allows users to log in to CAS using their
|
9
|
+
# Gmail/Google accounts.
|
10
|
+
class CASServer::Authenticators::Google < CASServer::Authenticators::Base
|
11
|
+
def validate(credentials)
|
12
|
+
read_standard_credentials(credentials)
|
13
|
+
|
14
|
+
return false if @username.blank? || @password.blank?
|
15
|
+
|
16
|
+
auth_data = {
|
17
|
+
'Email' => @username,
|
18
|
+
'Passwd' => @password,
|
19
|
+
'service' => 'xapi',
|
20
|
+
'source' => 'RubyCAS-Server',
|
21
|
+
'accountType' => 'HOSTED_OR_GOOGLE'
|
22
|
+
}
|
23
|
+
|
24
|
+
url = URI.parse('https://www.google.com/accounts/ClientLogin')
|
25
|
+
http = Net::HTTP.new(url.host, url.port)
|
26
|
+
http.use_ssl = true
|
27
|
+
|
28
|
+
# TODO: make the timeout configurable
|
29
|
+
wait_seconds = 10
|
30
|
+
begin
|
31
|
+
timeout(wait_seconds) do
|
32
|
+
res = http.start do |conn|
|
33
|
+
req = Net::HTTP::Post.new(url.path)
|
34
|
+
req.set_form_data(auth_data,'&')
|
35
|
+
conn.request(req)
|
36
|
+
end
|
37
|
+
|
38
|
+
case res
|
39
|
+
when Net::HTTPSuccess
|
40
|
+
true
|
41
|
+
when Net::HTTPForbidden
|
42
|
+
false
|
43
|
+
else
|
44
|
+
$LOG.error("Unexpected response from Google while validating credentials: #{res.inspect} ==> #{res.body}.")
|
45
|
+
raise CASServer::AuthenticatorError, "Unexpected response received from Google while validating credentials."
|
46
|
+
end
|
47
|
+
end
|
48
|
+
rescue Timeout::Error
|
49
|
+
$LOG.error("Google did not respond to the credential validation request. We waited for #{wait_seconds.inspect} seconds before giving up.")
|
50
|
+
raise CASServer::AuthenticatorError, "Timeout while waiting for Google to validate credentials."
|
51
|
+
end
|
52
|
+
|
53
|
+
end
|
54
|
+
end
|