server packetfence-tunnel {

authorize {	
        suffix
        ntdomain
        eap {
                ok = return
        }
        files
####Activate local user eap authentication based on a specific SSID ####
## Set Called-Station-SSID with the current SSID
#        set.called_station_ssid
#        if (Called-Station-SSID == 'Secure-Wireless') {
## Disable ntlm_auth
#            update control {
#                MS-CHAP-Use-NTLM-Auth := No
#            }
## Check password table for local user
#            pflocal
#            if (fail || notfound) {
## Check password table with email and password for a sponsor registration
#                pfguest
#                if (fail || notfound) {
## Check password table with email and password for a guest registration
#                    pfsponsor
#                    if (fail || notfound) {
## Check activation table with phone number and PIN code 
#                        pfsms
#                        if (fail || notfound) {
#                            update control {
#                               MS-CHAP-Use-NTLM-Auth := Yes
#                            }
#                        }
#                    }
#                }
#            }
#        }
        expiration
        logintime
}

authenticate {
        Auth-Type MS-CHAP {
                mschap
        }
        eap
}

session {
        radutmp
}

post-auth {
        exec
        update control {
            PacketFence-RPC-Server = ${rpc_host}
            PacketFence-RPC-Port = ${rpc_port}
            PacketFence-RPC-User = ${rpc_user}
            PacketFence-RPC-Pass = ${rpc_pass}
            PacketFence-RPC-Proto = ${rpc_proto}
        }
        packetfence
        Post-Auth-Type REJECT {
                attr_filter.access_reject
        }
}

pre-proxy {
}

post-proxy {
        eap
}
} # packetfence-tunnel server block
