Reply-Message in postauth_query
Hello, I am using freeradius 2.2.5 with MySQL. my postauth_query looks like the following : postauth_query = "INSERT INTO radpostauth \ (username, password, reply, authdate,service,mac,nasip,nasid) \ VALUES ( \ '%{User-Name}', \ '%{%{User-Password}:-%{Chap-Password}}', \ '%{reply:Packet-Type}', '%S', \ '%{Called-Station-Id}', \ '%{Calling-Station-Id}' ,\ '%{NAS-IP-Address}' ,\ '%{NAS-Identifier}')" in the reply field , I always get either Access-Reject or Access-Accept from reply:Packet-Type. What other options I have for reply: other than Packet-Type ? Is it possible to reach the Reply-Message from within postauth_query ? Thank you.
Hasanen AL-Bana wrote:
in the reply field , I always get either Access-Reject or Access-Accept from reply:Packet-Type. What other options I have for reply: other than Packet-Type ?
Any other attribute. They're just strings. Put the attribute name in there, and it will work.
Is it possible to reach the Reply-Message from within postauth_query ?
Yes. To get the value of the Reply-Message from the reply, use: %{reply:Reply-Message} See "man unlang" for exhaustive documentation on this. Alan DeKok.
reply:Reply-Message always comes empty when incorrect username or password used , turned out that I have to define custom Reply-Message in Authorize section like this : sql { notfound = 1 reject = 2 } if(notfound){ update reply { Reply-Message := "Login Failed. Please check your Username and Password" } ok = reject } if(reject){ update reply { Reply-Message := "Login Failed. Please check your Username and Password" } ok = reject } I will check unlang for more details, thanks. On Fri, Sep 26, 2014 at 8:33 PM, Alan DeKok <aland@deployingradius.com> wrote:
Hasanen AL-Bana wrote:
in the reply field , I always get either Access-Reject or Access-Accept from reply:Packet-Type. What other options I have for reply: other than Packet-Type ?
Any other attribute. They're just strings. Put the attribute name in there, and it will work.
Is it possible to reach the Reply-Message from within postauth_query ?
Yes. To get the value of the Reply-Message from the reply, use:
%{reply:Reply-Message}
See "man unlang" for exhaustive documentation on this.
Alan DeKok. - List info/subscribe/unsubscribe? See http://www.freeradius.org/list/users.html
participants (2)
-
Alan DeKok -
Hasanen AL-Bana