gcnovus-casrack_the_authenticator 1.0.0 → 1.1.0
Sign up to get free protection for your applications and to get access to all the features.
- data/README.rdoc +36 -0
- metadata +1 -1
data/README.rdoc
CHANGED
@@ -49,3 +49,39 @@ See CasrackTheAuthenticator::Configuration for specifics on that Hash argument.
|
|
49
49
|
username = Rack::Request.new(request.env).session[CasrackTheAuthenticator::USERNAME_PARAM]
|
50
50
|
User.find_by_username(username)
|
51
51
|
end
|
52
|
+
|
53
|
+
=== Disconnected (Fake) Mode
|
54
|
+
|
55
|
+
I've often found myself working on a CAS-ified project while away from the office
|
56
|
+
and unable to access the CAS server. To support this type of disconnected development,
|
57
|
+
just substitute in the CasrackTheAuthenticator::Fake middleware. It acts like
|
58
|
+
CasrackTheAuthenticator::Simple, but it uses HTTP Basic authentication against a
|
59
|
+
preset list of usernames.
|
60
|
+
|
61
|
+
A common pattern for Rails apps is to create a disconnected environment:
|
62
|
+
|
63
|
+
==== 1: set up <tt>[rails_root]/config/database.yml</tt>
|
64
|
+
|
65
|
+
development: &DEV
|
66
|
+
adapter: sqlite3
|
67
|
+
database: db/development.sqlite3
|
68
|
+
pool: 5
|
69
|
+
timeout: 5000
|
70
|
+
|
71
|
+
# development mode when disconnected from MITRE
|
72
|
+
disconnected:
|
73
|
+
<<: *DEV
|
74
|
+
|
75
|
+
==== 2: set up <tt>[rails_root]/config/disconnected.rb</tt>:
|
76
|
+
|
77
|
+
load './development.rb'
|
78
|
+
config.middleware.swap 'CasrackTheAuthenticator::Simple', CasrackTheAuthenticator::Fake, 'jimbob', 'sueann'
|
79
|
+
|
80
|
+
==== 3: run in disconnected mode:
|
81
|
+
|
82
|
+
script/server -e disconnected
|
83
|
+
|
84
|
+
==== 4: login as 'jimbob' or 'sueann'
|
85
|
+
|
86
|
+
Passwords are ignored.
|
87
|
+
|