Be more forgiving when starting proxy sockets.
[freeradius.git] / doc / Autz-Type
1 Like Auth-Type for authentication method selection freeradius also
2 supports the Autz-Type to select between authorization methods.  The only
3 problem is that authorization is the first thing to be called when an
4 authentication request is handled.  As a result we first have to call the
5 authorize section without checking for Autz-Type. After that we check for
6 Autz-Type and if it exists we call the corresponding subsection in the
7 authorize section.  In other words the authorize section in radiusd.conf
8 should look like this:
9
10
11 authorize{
12         suffix
13         preprocess
14         # whatever other authorize modules here
15         Autz-Type Ldap{
16                 ldap
17         }
18         Autz-Type SQL{
19                 sql
20         }
21         files
22 }
23
24 What happens is that the first time the authorize section is examined the
25 suffix, preprocess and files modules are executed.  If Autz-Type is set
26 after that the server core checks for any matching Autz-Type subsection.
27 If one is found it is called.  The users file should look something
28 like this:
29
30 DEFAULT Called-Station-Id == "123456789", Autz-Type := Ldap
31
32 DEFAULT Realm == "other.company.com", Autz-Type := SQL
33
34 Autz-Type could also be used to select between multiple instances of
35 a module (ie sql or ldap) which have been configured differently.  For
36 example based on the user realm different ldap servers (belonging to
37 different companies) could be queried.  If Auth-Type was also set then we
38 could do both Authentication and Authorization with the user databases
39 belonging to other companies.  In detail:
40
41 radiusd.conf-----------------
42
43 authenticate{
44         Auth-Type customer1{
45                 ldap1
46         }
47         Auth-Type customer2{
48                 ldap2
49         }
50 }
51
52 authorize{
53         preprocess
54         suffix
55         Autz-Type customer1{
56                 ldap1
57         }
58         Autz-Type customer2{
59                 ldap2
60         }
61         files
62 }
63
64 -----------------------------
65
66 users file-------------------
67
68 DEFAULT Realm == "customer1", Autz-Type := customer1, Auth-Type := customer1
69
70 DEFAULT Realm == "customer2", Autz-Type := customer2, Auth-Type := customer2
71
72 ----------------------------
73
74 Apart from Autz-Type the server also supports the use of
75 Acct-Type, Session-Type and Post-Auth-Type for the corresponding sections.
76 The corresponding section names in the radiusd.conf file are the same.  So for example:
77
78 users file---
79
80 DEFAULT Called-Station-Id == "236473", Session-Type := SQL
81
82 radiusd.conf---
83
84 session {
85         radutmp
86         Session-Type SQL {
87                 sql
88         }
89 }