# BinAuth
- Potential usage: Let the daemon know that client x was automatically deauthenticated for y reason
- This enables the daemon to run a bit more asynchronously and prevents a possible race condition where e.g. [[OpenNDS]] deauthenticates a client due to hitting a quota limit while a command to balance the download / upload quotas using [[ndsctl]] auth is in flight from the daemon to [[ndsctl]]
- Potential alternative: Continuously poll `ndsctl status` for updates
- Additionally poll `ndsctl status` whenever a client request comes in via the captive portal, so that the information acted upon is always fresh
## Docs > Configuration > [[BinAuth]]
https://opennds.readthedocs.io/en/stable/config.html#enable-binauth-support
### Enable BinAuth Support.
- Default disabled
- BinAuth enables POST AUTHENTICATION PROCESSING and and is useful in particular when a FAS is configured remotely.
- If set, a BinAuth program or script is triggered by several possible methods and is called with several arguments on both authentication and deauthentication.
### Possible methods
#### Authentication:
- “auth_client”: Request for authentication received from the captive portal splash page.
- “client_auth”: Acknowledgement that Client was authenticated via this script.
- “ndsctl_auth”: Client was authenticated by ndsctl auth command.
#### Deauthentication:
- “client_deauth”: Client deauthenticated by the client via captive portal splash page.
- “idle_deauth”: Client was deauthenticated because of inactivity.
- “timeout_deauth”: Client was deauthenticated because the session timed out.
- “ndsctl_deauth”: Client was deauthenticated by ndsctl deauth command.
- “uprate_deauth”: Client was deauthenticated because its average upload rate exceeded the allowed value.
- “downrate_deauth”: Client was deauthenticated because its average download rate exceeded the allowed value.
- “upquota_deauth”: Client was deauthenticated because its upload quota exceeded the allowed value.
- “downquota_deauth”: Client was deauthenticated because its download quota exceeded the allowed value.
- “shutdown_deauth”: Client was deauthenticated by openNDS terminating.
A fully functional BinAuth script is pre-installed and provides local logging of client activity.
This is enabled by the following option:
`option binauth '/usr/lib/opennds/binauth_log.sh'`