Debian Codegraph @

doc/antora/modules/concepts/pages/session/processing.adoc

raw
1 = Processing
2
3 The server processes requests through local site policy. That policy is used to examine the request, the request attributes, and the attribute values. The server then builds a reply message using responses (determined by local policy) such as time of day restrictions, group access limitations, and IP address
4 allocation. The processing stage may include keeping track of <<server-attr,server-side attributes>>.
5
6 == How things work in RADIUS
7
8 The client sends the server a RADIUS authentication request. You don't decide what's in the request, the client does. The server doesn't decide what's in the request, the client does. The client is 100% responsible for everything in the request.
9
10
11 .FreeRADIUS v3 Request Flow
12 image:request_flow.svg[Process Flow railroad diagram].
13
14 === Summary of the Request Flow Steps
15
16 . An end-user tries to access a network through a RADIUS client such as a wireless access point. 
17 . The RADIUS client sends a request to the RADIUS server along with the user's credentials.
18 . The RADIUS server verifies the user's credentials against its datastore (flat file, SQL, LDAP, etc.). 
19 . If authentication passes, the server returns configuration details (including authorisation) to the client. The client can now grant network access to the end-user 
20 . If the authentication fails, the server denies access, and the RADIUS client informs the end-user.
21
22
23 Users new to RADIUS, AAA, or EAP are encouraged to read the standards listed below. This documentation provides you with a solid foundation in RADIUS concepts and EAP at a protocol level.
24
25 - https://datatracker.ietf.org/doc/html/rfc2865[RFC 2865] - Remote Authentication Dial In User Service (RADIUS)
26 - https://datatracker.ietf.org/doc/html/rfc2866[RFC 2866] - RADIUS Accounting
27
28 - https://datatracker.ietf.org/doc/html/rfc3748[RFC 3748] - Extensible Authentication Protocol (EAP)
29 - https://datatracker.ietf.org/doc/html/rfc2865[RFC 3579] - RADIUS Support For Extensible Authentication Protocol (EAP)
30
31
32 == Request Processing
33
34 When the server processes requests, it manages four xref:unlang:list.adoc[attribute lists]. All of these lists are available to all modules. All of these lists are available in xref:unlang:index.adoc[Unlang]
35
36 .Attribute Lists and Details
37
38 [cols="1,2"]
39 |===
40 |*Attribute List*|*Description*
41
42 |`request`
43 |Attributes taken from the received packet.
44
45 |`reply`
46 |Attributes which will be sent in the reply.
47
48 |`control`
49 |Attributes used to control how the server operates. These are never sent in a packet.
50
51 |`session-state`
52 |Attributes which are saved and restored across multiple request / reply exchanges.
53 |===
54
55
56
57 == Select an Auth-Type - authorise {}
58
59 The RADIUS server looks at the request and says:
60
61 > Hmmm... can I deal with this request?
62
63 The answer to that depends on what authentication types are enabled in the server, what the server can look up in a datastore, and what is in the request.
64
65 The server starts querying the modules in the authorise section:
66
67 > Unix module, can you handle this one?
68
69 > Pap module, can you handle this one?
70
71 > Mschap module, can you handle this one?
72
73 At some point, one of the modules will say:
74
75 > Yes, I see something in the request I recognize. I can do something!
76
77 The module does this by looking for key attributes in the received request, such as MS-CHAP-Challenge (for mschap), or CHAP-Challenge (for chap), or EAP-Message (for eap). Or it may just assume it needs to add something to every request.
78
79 If the module thinks has a possibility of authenticating the user, it'll say:
80
81 > I can't authenticate this user now (I was just told to authorise them i.e. set the Auth-Type),
82 > but my pal in the Authenticate section can!
83 > Hey, set the Auth-Type to me!
84
85 TThe module performs no action if it doesn't recognize anything in the request. If the module knows it doesn't need to do lookups, the module also does nothing.
86
87 == Authenticate a user - authenticate {}
88
89 At the end of the authorise process, the server checks if the Auth-Type has been set by a module.
90
91 If no module sets the Auth-Type, the server immediately rejects the request.
92
93 For example, the client sends a request with a User-Password attribute, and pap is enabled. The pap module then sets the ``Auth-Type = pap``.
94
95 During this authenticate process, the server calls the pap module again:
96
97 > I see a User-Password, which is what the user entered.
98 > That's nice, but I need to compare it with something.
99 > Ah! Another module added the "known good" password for this user in authorise!
100
101 Next, the server compares the local "known good" password to the password as entered by the user. This is how authentication works.
102
103 The "known good" password comes from another module. The pap module just does PAP authentication, and nothing more. The benefit of this approach is that the "known good" password can come from the 'users' file, SQL, LDAP, ``/etc/passwd``, or any external program.
104
105 For this example, the ldap module is listed in the authorise section. It will have run and checked:
106
107 > Hmm... Can I find a "known good" password for this user?
108
109 If so, it will have added the "known good" password to the request, so that another module in authenticate can use it.
110
111 == Insufficient information
112
113 But WAIT! What if the client sends a MSCHAP request? What does the RADIUS server say then?
114
115 > Well, this difficult and not the same as previous request
116 > That client has made this difficult. I'm limited by some constraints!
117
118 In this case, the mschap module looks at the request, and finds the MS-CHAP attributes. It sets the *Auth-Type* to itself (mschap). A database module (such as LDAP, above) gets the "known good" password, and adds it to the request. The mschap module is then run for authentication. It looks for either a clear text password or nt-hash. See an explanation for this limitation is explained in the xref:protocol/authproto.adoc#Proto-Password-Compat[Protocol Password Compatibilty] table. If one of those hasn't been added by a database, the mschap module says:
119
120 > Sorry, I can't authenticate the user,
121 > because I don't have the information I need to validate MSCHAP.
122
123 But now the server has run out of options! Its only choice was mschap because that's what the client sent in the request. The mschap module can't do anything because you didn't give it a useful "known good" password . So the server has no choice but to reject the request. The MSCHAP data might be correct, but the server has no way to know that. So it replies with a reject.
124
125 // Copyright (C) 2025 Network RADIUS SAS. Licenced under CC-by-NC 4.0.
126 // This documentation was developed by Network RADIUS SAS.