Removed link to outdated documentation
[freeradius.git] / doc / aaa.txt
1 How Authorization, Authentication, and Accounting requests are handled
2 ----------------------------------------------------------------------
3
4 There are a lot of questions about misconfigured FreeRADIUS servers
5 because of misunderstanding of FreeRADIUS operations.  This document
6 explains how the server operates.
7
8
9 Normally there are 2 steps in processing authentication request coming
10 from NAS in FreeRADIUS (plus additional steps to proxy request if we
11 use FreeRADIUS as a proxy): authorization and authentication.
12
13
14 AUTHORIZATION
15
16 Authorization is a process of obtaining information about the user
17 from external source (file, database or LDAP), and checking that the
18 information in request is enough to authenticate user.  Authorization
19 modules deal with data sources, so ldap, sql, files, passwd are
20 authorization modules.
21
22 The authentication method is decided during the authorization phase,
23 along with any reply attributes.  The reason for this behaviour is
24 that for example, a user may not be permitted to use a particular
25 authentication method.  So during the authorize phase, we can deny
26 them the ability to use that kind of authentication.
27
28
29 AUTHENTICATION
30
31 Authentication is simply a process of comparing user's credentials in
32 request with credentials stored in database.  Authentication usually
33 deals with password encryption.  PAP, CHAP, MS-CHAP are authentication
34 modules.  Few modules act as both authorization and authentication.
35 For example, the MS-CHAP module is normally authentication only, but it
36 may be used during authorization to verify that request contains
37 MS-CHAP related attribute and only in this case perform MS-CHAP based
38 authentication. LDAP is normally an authorization module, but it may
39 be used for authentication (In this case FreeRADIUS will authenticate
40 user in case he can connect to LDAP server with his account).  SQL is
41 only an authorization module, as dial-in users are not normally given
42 passwords to access an SQL server.
43
44
45 PROCESSING A REQUEST
46
47 During authorization and authentication processes, there are 3 lists
48 of RADIUS attributes supported by FreeRADIUS: request items, config
49 items and reply items.  (See 'man 5 users' for additional
50 information.)  Attributes from the RADIUS authentication request
51 packet are included into request items list.  Both authorization and
52 authentication modules can add attributes into reply items list. These
53 attributes will be added to reply will be sent by RADIUS server to
54 NAS.  There is third list, called config items.  It's used for
55 internal FreeRADIUS operations, for example to pass some data from
56 authorization to authentication module.
57
58 Before authorization begins FreeRADIUS creates request items list with
59 attributes from request and empty config and reply lists.
60
61 An authorization module searches a database with attributes
62 (e.g. User-Name) taken from request list as a key, and fetches all
63 relevant records.  It retrieves 3 types of attributes: check
64 attributes, configure attributes and reply attributes. It compares the
65 check attributes with attributes from request items. If none of
66 database record for this User-Name matches in check attributes with
67 request items authorization will fail. If a matching record is found,
68 then the configure attributes will be added to configure items, and
69 the reply attributes will be added to reply items list.  The check
70 list may be required if we need to authenticate users with same name
71 for different services (for example to treat User1 from NAS1 and User1
72 from NAS2 as different users).
73
74 There should be at list one configure attribute provided by
75 authorization module, called Auth-Type (since this attribute is from
76 config items list it can't be in request or reply).  This attribute
77 decides which module will be used to authenticate the user.  The
78 Config items also contains information from database required to
79 authenticate user, for example valid user's password or it's hash,
80 login restrictions, etc.
81
82 A quite common mistake is to place the attributes in the wrong lists,
83 for example placing Auth-Type, Password, NT-Password etc in the check
84 list, or in the reply list.  When run in debugging mode, the server
85 will normally issue 'WARNING' messages saying that the attributes are
86 in the wrong list.
87
88 If you place Password into check list and user does cleartext
89 authentication it may work, because authorization module compares 2
90 cleartext passwords.  But if user does some encrypted authentication
91 (for example MS-CHAP), then the authorization will fail, because the
92 Password in the request items will not match the password in the check
93 attributes.  You should place Password attribute obtained from
94 database into configure items and also place Auth-Type attribute with
95 value of 'MS-CHAP' into same list.  The same goes for NT-Password
96 (before calling MS-CHAP Password attribute should be converted to
97 NT-Password, it may be achieved by calling mschap module in
98 authorization section after module which does actual authorization).
99
100
101 $Date$
102 by 3APA3A <3APA3A@SECURITY.NNOV.RU>