Problem:
Pihole’s authentication is based on a single password that is used for logging in into the FTL webserver and used for authentication in API requests.
- There is no option to enable basic auth, which would allow the reverse proxy to add the Authorization header in the requests routed to pihole
- There is no support for Remote-User to forward an externally authenticated user ID
- Disabling the password by setting
FTLCONF_webserver_api_password=’’allows authentication to be handled externally and not be faced with the Pi-hole login screen, but it also exposes the API within the network as it can now be reached with password ` `.
Request:
- Option A (better, allows logging by name): Provide option to configure a request header (e.g. ‘Remote-User’) and its value(s) which allows the admin to setup one or more user ID’s that need to be considered authenticated when the header and known value is present in a request to the webserver.
- Option B: introduce config
FTLCONF_webserver_external_login, defaultedfalse, whentrueany request to/adminis considered authenticated. - Option C: define a specific header (e.g.
X-FTL-Password) and implement a mechanism to use this forwarded and authenticate the session automatically. (This is only sent from the reverse proxy server to the application, not exposed externally.) - With either option in place, the
FTLCONF_webserver_api_passwordis be kept as the credential to request an API access token.