Customise reply-message

Can Paçacı pacaci at servisnet.com.tr
Thu Aug 25 10:10:37 UTC 2022



On 8/24/22 18:17, Alan DeKok wrote:
> On Aug 24, 2022, at 3:45 AM, Can Paçacı <pacaci at servisnet.com.tr> wrote:
>> How can we send the reply-message to NAS according to which attribute in the radcheck table failed during the user authentication phase? Now, it returns the reply-message, Wrong-password and wrong-user only. If the NAS-identifier attribute in the radcheck table failed, we want it to send a separate reply-message. Is it possible?
>    I'm not sure what that means.
>
>    The documentation on the SQL module explains how it works.  See https://wiki.freeradius.org/modules/Rlm_sql
>
>    There is no way to "do something else if the rad check condition doesn't match".
>
>    What you can do is to add a condition which matches what you want, and then adds a reply.  eg.
>
> 	NAS-identiifier != Foo
>          Reply-Message = "bar"
Hi again,
I have configured site default file as in the followings but  it gives 
the same error on wrong User-Password and wrong NAS-Identifier.
How can both cases be separated

######
         update reply {
         Reply-Message = "test**** Wrong NAS: %{NAS-Identifier} "
                 }
#####
         update reply {
         #Reply-Message = " Wrong Password..."
         Reply-Message = "%{Reply-Message} Wrong Password"
         }
                 -sql

[root at test-servisnet sites-enabled]# echo 
"User-Name='deneme1 at kablonet',User-Password='1234',NAS-Identifier=06UlusRHUA0" 
| radclient -x 127.0.0.1 auth secret11
Sent Access-Request Id 100 from 0.0.0.0:54846 to 127.0.0.1:1812 length 69
     User-Name = "deneme1 at kablonet"
     User-Password = "1234"
     NAS-Identifier = "06UlusRHUA0"
     Cleartext-Password = "1234"
Received Access-Reject Id 100 from 127.0.0.1:1812 to 0.0.0.0:0 length 54
     Reply-Message = "test**** Wrong NAS: 06UlusRHUA0 "
(0) -: Expected Access-Accept got Access-Reject

>
>    Alan DeKok.
>
> -
> List info/subscribe/unsubscribe? See http://www.freeradius.org/list/users.html

-- 
Can Paçacı
pacaci at servisnet.com.tr
Servisnet A.Ş.
Tel: 90 216 9999677
      90 530 5450952



More information about the Freeradius-Users mailing list