• Home
  • History
  • Annotate
Name Date Size #Lines LOC

..03-May-2022-

cgi/H03-May-2022-1,124624

conf/H03-May-2022-1118

contrib/H03-Mar-2009-732405

doc/H03-May-2022-446297

src/H03-May-2022-2,9582,196

t/H03-May-2022-2,8802,058

CREDITSH A D05-Mar-20095 KiB10679

ChangeLogH A D10-Jul-200921.9 KiB654653

ChangeLog.1H A D16-Feb-200989.6 KiB3,4072,139

ChangeLog.2H A D16-Feb-200914.7 KiB505325

INSTALLH A D16-Feb-20093.6 KiB9567

LICENSEH A D16-Feb-20093.3 KiB6968

MakedefsH A D03-May-2022437 1411

MakefileH A D03-Mar-2009268 2013

READMEH A D16-Feb-20098.8 KiB222160

README.upgrading_to_2.0.xH A D16-Feb-2009842 1914

VERSIONH A D10-Jul-20096 21

configureH A D03-Mar-20092.8 KiB11588

mod_auth_tkt.specH A D10-Jul-20096.6 KiB173134

README

1Introduction
2------------
3
4See the INSTALL file for installation instructions.
5
6  *NOTE: this version of mod_auth_tkt (2.0.x) works with Apache
7   1.3.x, 2.0.x, and 2.2.x. The older mod_auth_tkt 1.3.x is now
8   deprecated, and all users are encouraged to upgrade.*
9
10mod_auth_tkt is a lightweight cookie-based authentication module for
11Apache, written in C. It implements a single-signon framework that works
12across multiple apache instances and multiple machines. The actual
13authentication is done by a user-supplied CGI or script in whatever
14language you like (examples are provided in Perl), meaning you can
15authenticate against any kind of user repository you can access
16(password files, ldap, databases, etc.)
17
18mod_auth_tkt supports inactivity timeouts (including the ability to
19control how aggressively the ticket is refreshed), the ability to
20include arbitrary user data within the cookie, configurable cookie names
21and domains, and token-based access to subsections of a site.
22
23mod_auth_tkt works by checking incoming Apache requests for a (user-
24defined) cookie containing a valid authentication ticket. The ticket is
25checked by generating an MD5 checksum for the username and any
26(optional) user data from the ticket together with the requesting IP
27address and a shared secret available to the server. If the generated
28MD5 checksum matches the ticket's checksum, the ticket is valid and the
29request is authorised. Requests without a valid ticket are redirected to
30a configurable URL which is expected to validate the user and generate a
31ticket for them. This package includes a Perl module for generating the
32cookies; implementations for other environments should be relatively
33straightforward.
34
35
36
37Pros and Cons
38-------------
39
40The mod_auth_tkt scheme has several advantages and only one significant
41disadvantage:
42
43Advantages -
44
451. Usable on any apache webserver: because it's written in C using only
46the Apache C API, mod_auth_tkt should be usable on the simplest stripped
47down Apache server - no mod_perl, mod_php, or servlets required.
48mod_auth_tkt's only requirement is that the Apache supports DSO (Dynamic
49Shared Objects).
50
512. Single-signon across Apaches and machines, including mixed
52environments: mod_auth_tkt enables a user to login once and then be
53seamlessly authorised across multiple Apaches or machines. Mixed
54environments work fine too - lightweight static HTML Apache with heavier
55mod_perl/mod_php/servlet enabled Apache, or a mixed Unix/Windows
56environment. Only requirements are a shared secret across all the
57servers.
58
593. Pluggable authentication and authorisation: mod_auth_tkt hands off
60the authentication and authorisation problem to the URL of your choice.
61This means that you can use whatever technology (CGI, Perl, PHP, ASP,
62Java etc.) and whatever repositories (passwd files, LDAP, NIS, RDBMS,
63radius, or any combination thereof) you like - as long as the
64authorising page or script generates a valid ticket for a valid user
65everything should work just fine.
66
674. Drop-in replacement for Basic Authentication: mod_auth_tkt sets
68the Basic Authentication REMOTE_USER environment variable on authorised
69requests, so that existing scripts that work with Basic Authentication
70should work unchanged in a mod_auth_tkt environment.
71
725. No server-side storage requirements: because cookies are basically
73a client-side storage technology, there are no storage requirements
74on the server side - no session database is required (although you're
75free to use one if it already exists).
76
776. Supports cross-domain authentication (as of version 1.3.8): although
78cookies are domain specific, the newest version of mod_auth_tkt allows
79initial tickets to be passed via URLs, allowing single-signon across
80completely unrelated domains (www.foo.com and www.bar.com).
81
82
83Disadvantages -
84
851. Requires cookies: browsers without cookie support will never have a
86valid ticket and will therefore never be authorised by mod_auth_tkt.
87There are no current plans to support non-cookie-based authentication.
88
89
90
91
92Protocol Details
93----------------
94
951. Login procedure (by user script/CGI)
96
971.1 User logs in by supplying user credentials to server-side
98    login module. Login module is implemented e.g., as CGI or servlet.
99
1001.2 Login module has access to a login database that has following
101    information: user credentials and additional information such
102    as user class/groups etc.
103
1041.3 If login module finds that user credentials supplied matches
105    the ones in database, an authentication cookie is constructed.
106
1071.4 Contents of authentication cookie: user ID, client IP address,
108    timestamp, optional token list, optional user data, plus an
109    MD5 checksum to ensure the integrity of the cookie. The MD5
110    checksum is generated from following information:
111     - shared secret
112     - user ID
113     - client IP address
114     - timestamp
115     - token list, if supplied
116     - user data, if supplied
117
1181.5 The basic format of the ticket / authentication cookie value is
119    as follows:
120
121    ticket := <MD5-checksum> <timestamp> <uid> ['\0' <tokens>] ['\0' <user-data>]
122
123    tokens := ! <token1> [ , <token2> ... ]
124
125    user-data := ! <arbitrary-user-data>
126
127
128
129
1302. Request authentication by mod_auth_tkt
131
1322.1 If no authentication cookie is present in a request, request is
133    redirected to a configurable login URL.
134
1352.2 If authentication cookie is present and timeout checking is
136    enabled, timestamp in the cookie is compared with the current time
137    on the server. If the cookie has expired, request is redirected to a
138    configurable timeout URL.
139
1402.3 If authentication cookie is present and not expired, MD5 checksum is
141    generated as described in 1.4. The MD5 checksum in cookie is
142    compared with the one generated. If they match the user is
143    successfully authenticated.
144
1452.4 If a TKTAuthToken is also required for this url/area, mod_auth_tkt
146    will then check the first field of the user_data (which has been
147    checked via the MD5 checksum in the previous step) for a comma-
148    separated list of tokens for this user. If the required token is
149    not found in this list, the request is redirected to a configurable
150    unauthorised URL.
151
1522.4 Upon successful authentication authentication mod_auth_tkt sets
153    environment variables for user ID and user data. User data is also
154    placed in query string.
155
1562.5 If authentication fails, request is redirected as in 2.1.
157
1582.6 Upon redirection in 2.1, 2.2 or 2.4 mod_auth_tkt attempts to pass
159    the requested URL as a 'back' link so that after checking user
160    credentials login module can bounce the request back again. If
161    the TktAuthBackCookieName parameter is set, mod_auth_tkt will set
162    a cookie with that name to hold this link; otherwise it will pass
163    it as a GET parameter to the authenticating URL (back=<url>).
164
165
166Cookie Format
167-------------
168
169The TKTAuthCookieName cookie is constructed using following algorithm:
170
171('+' is concatenation operation)
172
173cookie := digest + hextimestamp + user_id + '!' + user_data
174
175or if using tokens:
176
177cookie := digest + hextimestamp + user_id + '!' + token_list + '!' + user_data
178
179digest := MD5(digest0 + key)
180
181digest0 := MD5(iptstamp + key + user_id + '\0' + token_list + '\0' + user_data)
182
183iptstamp is a 8 bytes long byte array, bytes 0-3 are filled with
184client's IP address as a binary number in network byte order, bytes
1854-7 are filled with timestamp as a binary number in network byte
186order.
187
188hextimestamp is 8 character long hexadecimal number expressing
189timestamp used in iptstamp.
190
191token_list is an optional comma-separated list of access tokens
192for this user. This list is checked if TKTAuthToken is set for a
193particular area.
194
195user_data is optional
196
197
198
199Credits and Disclaimer
200----------------------
201
202This is the Open Fusion version of the mod_auth_tkt Apache module.
203mod_auth_tkt was originally written by Raimondas Kiveris for Liquid
204Digital Information Systems, Inc. (see http://www.ldis.com/tkt_auth/),
205and further developed by Nelio Alves Pereira Filho
206(see http://www.ime.usp.br/~nelio/software/apache/). This version is
207the work of Gavin Carr of Open Fusion Pty. Ltd. (Australia), and the
208contributors cited in the CREDITS file in the distribution. The
209definitive site for this version is http://www.openfusion.com.au/labs.
210
211THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
212WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
213MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.  IN
214NO EVENT SHALL THE APACHE GROUP OR ITS CONTRIBUTORS BE LIABLE FOR ANY
215DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
216DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
217OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
218HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
219STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
220ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
221POSSIBILITY OF SUCH DAMAGE.
222

README.upgrading_to_2.0.x

1 Upgrading from mod_auth_tkt version 1.3.x to version 2.0.x
2 ==========================================================
3 
4 In general, upgrading should be a non-issue - just recompile and reinstall
5 mod_auth_tkt on each of your apache instances, both apache 1.3.x and
6 apache 2.0.x.
7 
8 The only gotcha is that the ticket format has changed (due to a
9 vulnerability in the previous format), so tickets produced using the old
10 TktUtil.pm or tkt_cookie will not work with mod_auth_tkt 2.0.x - use the
11 new Apache::AuthTkt perl module instead (or see the contrib directory
12 for possible alternatives).
13 
14 Also, the C tkt_cookie executable for generating cookies has been removed
15 from this version due to additional vulnerabilities and the maintenance
16 overhead. If you used that, you'll have to use the Perl cgi scripts
17 instead, or roll your own solution.
18 
19