Time for action – referencing attributes
In this section we shall make use of attributes.
Attributes in the if statement
Unlang can be used in various sections inside a virtual server definition. Previously we have used it in the authorize
section. You should not use unlang inside the authenticate
section as per instruction of the FreeRADIUS authors. We will use unlang in the post-auth
section to determine if Auth-Type = PAP
was used and give feedback if it was indeed used to authenticate a user.
- Edit the
sites-available/default
virtual server under the FreeRADIUS configuration directory and add the following inside thepost-auth
section, at the top of the section:if(control:Auth-Type == 'PAP'){ update reply { Reply-Message := "We are using %{control:Auth-Type} authentication" } }
- Restart FreeRADIUS in debug mode and try to authenticate as alice.
The
Reply-Message
specified should be included inside the reply.
What just happened?
We have used unlang...