Auth failed accounts and write to SQL database

Steven Walters steven.walters1 at gmail.com
Wed Mar 15 06:21:21 UTC 2023


Hi

I am not sure what I am trying dp=o is possible but lets try.

I have the following statement  under authenticate to accept "guest" users
even if the password is correct.

        Auth-Type PAP {
                pap{
                    reject=1
                }
                if (reject && (User-Name == "guest")) {
                    accept
                }
        }

Under post-auth I write failed requests to postauth_table.  In the case of
a "guest" user's password being incorrect, it will accept the
authentication and not write the record to the postauth_table.

What I require is that in the case of the password being incorrect for a
"guest" user, I need to accept the request but write a record to the
postauth_table (reply field)  as access-reject. This is that we have a
record of access-rejects for "guest" users but still allow them to connect
with limited connectivity.

I thought of using a variable, like below, to write the value to the reply
field in the postauth_table but it seems one can't do much under Auth-Type
PAP.

        Auth-Type PAP {
                pap{
                    reject=1
                }
                if (reject && (User-Name == "guest")) {
                 response_type = " Access-Reject"
                accept
                }
        }

What are my options?

Kind Regards
Steven


More information about the Freeradius-Users mailing list