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